Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Local Time vs another time zone Post Reply Post New Topic
Author Message
db3712
Groupie
Groupie
Avatar

Joined: 30 Oct 2008
Location: United States
Online Status: Offline
Posts: 44
Quote db3712 Replybullet Topic: Local Time vs another time zone
     Posted: 02 Jul 2012 at 12:14pm
I have a formula to figure out the difference between a db field time and the current time seen below.  The problem is that the current time is obviously my local CST time.  The db time differs based on the locations time zone.  I do have time zones setup in our system.  Any idea how pull in the current time based on what time zone the location is in?  Thank you.
 
datediff('n',{labor.dispatch_tm},currentdatetime)>60
IP IP Logged
c16271
Groupie
Groupie
Avatar

Joined: 24 Aug 2010
Location: United States
Online Status: Offline
Posts: 48
Quote c16271 Replybullet Posted: 05 Jul 2012 at 7:14am

What type of DB are you using? If you're using an Oracle DB, try looking into LOCALTIMESTAMP.

http://docs.oracle.com/cd/B19306_01/server.102/b14225/ch4datetime.htm
IP IP Logged
db3712
Groupie
Groupie
Avatar

Joined: 30 Oct 2008
Location: United States
Online Status: Offline
Posts: 44
Quote db3712 Replybullet Posted: 05 Jul 2012 at 9:37am
I'm using SQL 2008.  Thanks regardless.
IP IP Logged
c16271
Groupie
Groupie
Avatar

Joined: 24 Aug 2010
Location: United States
Online Status: Offline
Posts: 48
Quote c16271 Replybullet Posted: 05 Jul 2012 at 10:01am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 Jul 2012 at 12:14pm
you might try ShiftDateTime in CR...it is for adjusting by time zone.
 
you can also try searching CR help using the keyword 'zone'
 
never used it myself, but you can give it a try
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum