Convert EPOCH datetime

Comments

3 comments

  • Avatar
    Susvith Paduri

    AddSeconds(CreateDate(1970,1,1), ("epochdate"/1000)) HumanDate

     

     

    0
    Comment actions Permalink
  • Avatar
    Michel Provencher

    Thanx...

    I've came up with :

    AddDays(CreateDate(1970,01,01),(Epoch_date/86400)) Human_Date

    for days.

     

    What about the other way around: Human_Date - > Epoch_date ?

    0
    Comment actions Permalink
  • Avatar
    Richard Stubbs (Edited )

    Hi,

    seconddiff(human_date, create_date(1970,1,1))

    This will give you the Unix time (assuming your human_date uses UTC).

    If it's not in UTC you'll need to add or subtract the number of seconds corresponding to the difference between your human_date and UTC.

    For example if your human_date is the local time where the time zone is UTC-4, you would need to add 4 hours' worth of seconds:

    seconddiff(human_date, create_date(1970,1,1)) + 14400

     

    0
    Comment actions Permalink

Please sign in to leave a comment.