Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time Retriveal

Status
Not open for further replies.

brianjay

Programmer
Sep 14, 2000
42
US
I'm retriving data from a "MySQL" database into CR10. The data field contains an entered time (ex. 3:45pm). When I view the CR data the time appears as (ex. 12:00am). The data is being entered via a web site and I suspect that the server is configured weird. Is there anything outside the norm that I may have missed in CR. The "time format" in "options" is set properly.
 
Can you show the code (sql and script) that is used to retrieve this info? Are you using the date time functions in mysql's sql syntax to get the time out?


There are several functions there that may be useful:

GET_FORMAT(DATE|TIME|DATETIME, 'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL')

FROM_UNIXTIME(unix_timestamp)

DATE_FORMAT(date,format)



Bastien

Cat, the other other white meat
 
I dont understand why one would want to use the servers time for storing in the database!

I simply insert the timestamp from the database..
the server and the database server might have different timezones set up, or the time might just be different.

To solve this, always store in db time and use db-time as reference. then you take difference between db-time and server-time. (works even with timezones).

I made a tz script to solve it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top