Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Time (new Date vs now())
caribe
hello,
I have a Birt report running on an Amazon server, in Florida, the report draws me on the footer, the time of report generation
html
<value-of> new Date () </ value-of> / / server time in Florida
and a field in a query "now ()", shows me the time in my country, the database is on Amazon.
you know the why of this?
Find more posts tagged with
Comments
lnix
Hi caribe!
I would guess the cause of this is that new Date() is client-side javascript code, so it pulls the date off your local computer. If now() is run as a query on the database, which is somewhere else, it is pulling the time off that machine. Make sense?
caribe
<blockquote class='ipsBlockquote' data-author="'lnix'" data-cid="105312" data-time="1340757066" data-date="26 June 2012 - 05:31 PM"><p>
Hi caribe!<br />
<br />
I would guess the cause of this is that new Date() is client-side javascript code, so it pulls the date off your local computer. If now() is run as a query on the database, which is somewhere else, it is pulling the time off that machine. Make sense?<br /></p></blockquote>
<br />
<br />
thank you linx,
CBR
the javascript code will not be run in the client because Rhino is not a client side javascript language but a server side thing. All Rhino expressions in your report will be run on the server.
If you use now in an SQL statement it will be replaced by the Database-Server at query time.
If your database server and your report server are in different timezones it makes a difference.