Iron Speed Technical Forums
Sign up Latest Topics

  Author   Comment  

Posts: 3
Reply with quote  #1 
I need to date/time stamp for audit purposes. However my issue is that my server hosting the application and users are in different time zones. The database uses the host server for date/time stamp for the insert of new record. The question I have is how can I continue to use the host server's date/time versus the end user's local time for an update to a record? The only options in ISD I see are for using the end user's local time.

Avatar / Picture

MVP Developer
Posts: 1,970
Reply with quote  #2 
You can use TimeZoneInfo class to convert UTC DateTime to Local DateTime:

You may use also DateTimeOffset To Local Time:

Jimi J


  Jaime Jegonia

Iron Speed MVP Developer

". . . and whoever sows generously will also reap generously" 2 Cor 9:6


Avatar / Picture

Iron Speed MVP
Posts: 556
Reply with quote  #3 

Jimmi mentions some great resources. Its not as straight forward as it should be (what is?). You have to determine the Timezone on the client which requires some javascript. There are routines out there which help. You then need (probably) to convert to .Net timezone values.

You need to always store UTC time in the database so check that there are no db defaults of gettime(), they all need to be the UTC variants of getetime. In your code do not use Datetime.Today, use the UTC version. (ToUtcDateTime etc)

You then need to ensure that dates are timezone converted before displaying. I have spent some time researching this and ended up modifiying the baseclasees DB date class to achieve this.

I hope to write it up one day as its complicated to completely automate this.


Tim Titchmarsh Iron Speed Consultant MVP
London UK based
+44 (0)1621 835002

Avatar / Picture

Posts: 72
Reply with quote  #4 

For adding a UtcNow() function to Iron Speed, please see:

I suggested this essential function be added to ISD 10, but it doesn't seem to have made the cut.


Previous Topic | Next Topic

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement