Anyone know a way in BR to convert a Unix Timestamp to work with BR?
Example of a Unix Timestamp 1660657729
Equivalent Date Time:
August 16, 2022 8:48:49 AM
Convert Unix Timestamp
Moderators: Susan Smith, admin, Gabriel
-
- Posts: 292
- Joined: Fri Jun 19, 2009 9:01 am
- Location: Lawrence, Kansas
- Contact:
Convert Unix Timestamp
Steve Koger
Computer Specialist
SEKESC-MACS Division
Computer Specialist
SEKESC-MACS Division
Re: Convert Unix Timestamp
See: https://www.unixtimestamp.com/
Seconds Since Jan 1/1970
Also, TIMER is BR is the same value:
Human Readable Time Seconds
1 Hour 3600 Seconds
1 Day 86400 Seconds
1 Week 604800 Seconds
1 Month (30.44 days) 2629743 Seconds
1 Year (365.24 days) 31556926 Seconds
I didn't do the math, but you should be able to compare the value to Timer (NOW) and then do date math.
Seconds Since Jan 1/1970
Also, TIMER is BR is the same value:
Human Readable Time Seconds
1 Hour 3600 Seconds
1 Day 86400 Seconds
1 Week 604800 Seconds
1 Month (30.44 days) 2629743 Seconds
1 Year (365.24 days) 31556926 Seconds
I didn't do the math, but you should be able to compare the value to Timer (NOW) and then do date math.
Re: Convert Unix Timestamp
David provided the magic formula!
pr date$(days(19700101)+timer/86400,'M/D/CY') = 8/16/2022
pr date$(days(19700101)+timer/86400,'M/D/CY') = 8/16/2022
-
- Posts: 292
- Joined: Fri Jun 19, 2009 9:01 am
- Location: Lawrence, Kansas
- Contact:
Re: Convert Unix Timestamp
Thanks! David and Luis Exactly what I needed!
Steve Koger
Computer Specialist
SEKESC-MACS Division
Computer Specialist
SEKESC-MACS Division
-
- Posts: 292
- Joined: Fri Jun 19, 2009 9:01 am
- Location: Lawrence, Kansas
- Contact:
Re: Convert Unix Timestamp
In actuality Luis, Timer is what I needed because I am trying to determine how long ago I authorized a user and the api returns a unix timestamp. So I can just subtract that timestamp from Timer and know how many seconds it has been! Perfect!
Thanks again both David for your correct calculation and Luis for pointing out the Timer function!
Thanks again both David for your correct calculation and Luis for pointing out the Timer function!
Steve Koger
Computer Specialist
SEKESC-MACS Division
Computer Specialist
SEKESC-MACS Division