Comments (7)
Could verify with latest v8 and pyv8 SVN code, I can't reproduce it on Windows
and
Debian/Linux x86.
Original comment by [email protected]
on 11 Apr 2010 at 12:42
- Changed state: Invalid
from pyv8.
Looks like a daylight saving time related problem. I've added:
print str(func(now)), str(now.strftime("%a %b %d %Y %H:%M:%S"))
before assertion and got this:
gauss@pmain:~/Projects/pyv8$ date
Вск Апр 11 19:08:05 MSD 2010
gauss@pmain:~/Projects/pyv8$ python PyV8.py
.....................Sun Apr 11 2010 20:08:54 GMT+0400 (MSD) Sun Apr 11 2010
19:08:54
F..............
======================================================================
FAIL: testDate (__main__.TestWrapper)
----------------------------------------------------------------------
Traceback (most recent call last):
File "PyV8.py", line 1006, in testDate
self.assert_(str(func(now)).startswith(now.strftime("%a %b %d %Y %H:%M:%S")))
AssertionError
----------------------------------------------------------------------
Ran 36 tests in 12.429s
FAILED (failures=1)
Original comment by [email protected]
on 11 Apr 2010 at 3:12
from pyv8.
Thanks for your feedback, I will study the daylight saving time more detail
later :)
Original comment by [email protected]
on 12 Apr 2010 at 1:37
- Changed state: Accepted
- Added labels: Component-Logic, OpSys-All
from pyv8.
I have debug the issue on a debian 5, it seems v8 and python use different time
zone, it is very strange, I need check their code for more detail. :S
Original comment by [email protected]
on 17 Jun 2010 at 4:13
from pyv8.
import datetime
import PyV8
class Global(PyV8.JSClass):
def now(self):
return datetime.datetime.now()
ctx = PyV8.JSContext(Global()) # create another context with the global object
ctx.enter()
javascript_now = ctx.eval("new Date()")
javascript_global_now = ctx.eval("now()")
python_now = datetime.datetime.now()
print("javascript_global_now=%s" % javascript_global_now)
print("javascript_now=%s" % javascript_now)
print("python_now=%s" % python_now)
Outputs three different timezones on MacOSX:
javascript_global_now=2012-07-21 08:20:06.104000
javascript_now=2012-07-21 07:20:06.103000
python_now=2012-07-21 01:20:06.104915
Original comment by [email protected]
on 21 Jul 2012 at 7:21
from pyv8.
Same here with
javascript_global_now=2012-08-27 08:15:01.376000
javascript_now=2012-08-27 07:15:01.376000
python_now=2012-08-27 09:15:01.376350
Python now is actually the correct time.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
Original comment by [email protected]
on 27 Aug 2012 at 7:16
from pyv8.
force to use summer (i.e., Daylight Saving) time, contribute by
Russell
Original comment by [email protected]
on 17 Apr 2013 at 4:38
- Changed state: Fixed
from pyv8.
Related Issues (20)
- Memory leak with evaluating pure JS HOT 3
- How to load contents of alert screen ?
- Update version on PyPI
- error: 'CLASSIC_MODE' is not a member of 'v8i' v8 API change ?
- REVISION
- AST can't visit object properties: No to_python (by-value) converter found for C++ type: v8::internal::ObjectLiteralProperty*
- src/Context.h:66:114: error: no member named 'HasOutOfMemoryException' in 'v8::Context'
- Help !!
- Precompiled for Debain x64 HOT 1
- Failed to pip install/build under linux x64 — lot of errors in src/Wrapper.cpp HOT 1
- segfault
- compile failed with error code 1
- Segmentation fault when incorrectly instantiating a new Date
- error install from pip
- a python object/memory leak problem
- build stalls on install/update GYP
- fatal error: 'v8.h' file not found
- compile error
- PyV8 segmentation fault with CherryPy HOT 2
- ImportError: No module named _PyV8 after install
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyv8.