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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Eastern time vs Central Time

Status
Not open for further replies.

kcoleman26

Technical User
Oct 26, 2007
66
US
CR 2008

I have built a report to calculate the difference between the currenttime and the time a record was made. When using the actual Crystal Report if I change my system time to eastern time the report works fine.

However when I load the report on the Business Objects website and run the report with my system time still set to eastern it shows the current time as central.

I was either looking for a formula to make the times always read eastern time. Or if there is some kind of function when loading the report on the Business Objects site/INFOVIEW that could make the time read eastern time.

THIS IS MY TIME DIFFERENCE FORMULA
whileprintingrecords;
numberVar dur := datediff("s",datetime(currentdate,{@f_time}), datetime(currentdate,{@f_currenttime}));
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");

Thanks,
Kerry
 
I haven't used this myself, but there is a function shiftdatetime(,,). You can look this up in Help. You can add an argument "" than indicates the local time zone based on the operating system, so you could theoretically use this to correct the time zone for the currentdate. If the operating system is already in your local time zone, then the conversion would have no effect.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top