# Time & Date Conversion to Unix Epoch

**URL:** <https://clarionhub.com/t/time-date-conversion-to-unix-epoch/8611>\
**Category:** questions\
**Tags:** winapi, time, date\
**Created:** [September 15, 2025, 7:19pm UTC](https://clarionhub.com/t/time-date-conversion-to-unix-epoch/8611 "2025-09-15T19:19:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![vitesse](https://clarionhub.com/user_avatar/clarionhub.com/vitesse/32/837_2.png) [@vitesse](https://clarionhub.com/u/vitesse)\
**Post date:** [September 15, 2025, 8:49pm UTC](https://clarionhub.com/t/time-date-conversion-to-unix-epoch/8611/2 "2025-09-15T20:49:54Z")

</div>

Hi Paul

StringTheory has some methods for those things but assuming you don’t have that, just extract the date out of your time stamp convert to Clarion date then subtract date(1,1,1970) and multiply that by the number of seconds in a day  
(ie. 24 \* 60 \* 60).

Then get the time and convert hours and minutes to seconds and add that on.

Usually people use equates for the various conversions as Mark does here:

> [@How to Calculate the Time Lapsed Between Two Dates & Times?](https://clarionhub.com/t/how-to-calculate-the-time-lapsed-between-two-dates-times/6249/2):
>
> I haven’t tested this at all, but something like this seems like what you’re looking for. TIME:Tick EQUATE( 1) TIME:Second EQUATE(100 \* TIME:Tick) TIME:Minute EQUATE( 60 \* TIME:Second) TIME:Hour EQUATE( 60 \* TIME:Minute) TIME:Day EQUATE( 24 \* TIME:Hour ) Dates.Span PROCEDURE(LONG xDateA, LONG xTimeA, LONG xDateB, LONG xTimeB, \*LONG xOutSpanDays, \*LONG xOutSpanTime) FirstDate LONG,AUTO FirstTime LONG,AUTO SecondDate LONG,AUTO SecondTime LONG,AUTO CODE IF (xDateA \< xDate…

---

_[View the full topic](https://clarionhub.com/t/time-date-conversion-to-unix-epoch/8611)._
