Classic Date.SecondsTo1970

  1. 5 weeks ago

    Karen A

    Oct 17 Pre-Release Testers

    Some may find these API 1.0 extension methods useful. This all goes in a module:

    Private Const SecondsTo1970 as Number = 2082844800
    
    Public Function SecondsFrom1970(Extends aDate as Date) as Double
      Return aDate.TotalSeconds - aDate.GMTOffset*3600.0  - SecondsTo1970  
    End Function
    
    
    Public Sub SecondsFrom1970(Extends aDate as Date, Assigns SecFrom1970 as Double)
      aDate.TotalSeconds = SecondsTo1970  + SecFrom1970 + aDate.GMTOffset*3600.0
    End Sub

or Sign Up to reply!