Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
Charax

Avatar / Picture

Registered:
Posts: 71
Reply with quote  #1 

Re: topic at http://sjc.ironspeed.com/post/TimeZones-..-again-5442932

While this is an old topic, it was of interest to me because I want to use GMT for all my audit entry times. Currently (ISD 9.2.0) there is no GMT function for the Formulas, so here's my solution:

If you edit the BaseFormulaUtils.vb file (of your project, not the IS installation), you can use that new function in database formulas. To add a GMT function, add this code following the existing Now() function:
        ''' <summary>
        ''' Returns today's date with current time in Coordinated Universal Time
        ''' </summary>
        ''' <returns>Today's date with current time in Coordinated Universal Time.</returns>
        Public Shared Function UtcNow() As DateTime
            Return DateTime.UtcNow
        End Function

Then, in the Batch Meister Wizard, make sure these formulas are present:
  ChangedOn = UtcNow()
  CreatedOn = UtcNow()

That accomplished, any table in your database with a datetime field named ChangedOn or CreatedOn will automatically have the GMT entered into those fields whenever an insert or update occurs.

Hope this is helpful. I'd like to hear from anyone who has a better way.

Charax


 

JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,948
Reply with quote  #2 
Charax,

I'm okay with that.


Thanks,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

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

yebi

Registered:
Posts: 8
Reply with quote  #3 
Thank you for pointing this out. I am using it.
TrucMi

Registered:
Posts: 220
Reply with quote  #4 
Thank you for sharing!
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Download Iron Speed Designer

Terms of Service Privacy Statement