Hello,
Is it possible to perform a DateTime calculation to get current time minus 10 minutes? For example
cTenMinutesBefore := DateTime() - 10
Thank you!
DateTime() - ( 10 / ( 24 * 60 ) )
Yes, it looks like the timestamp you provided is in milliseconds since the Unix epoch. To convert a Harbour date variable into a Unix timestamp expressed in milliseconds, you need to follow these steps:
Get the date value from the Harbour date variable.
Convert the date value to the Unix timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
Multiply the Unix timestamp by 1000 to convert it to milliseconds.
Here's a simple example in Harbour script:
// Assuming you have a Harbour date variable named myDate
myDate := DToT(DATE(2024, 02, 10))
// Step 2: Convert to Unix timestamp (seconds)
unixTimestamp := myDate - DATE(1970, 01, 01)
// Step 3: Convert to milliseconds
unixTimestampMilliseconds := unixTimestamp * 1000
? "Unix Timestamp in milliseconds:", unixTimestampMilliseconds
This code assumes myDate contains the Harbour date variable you want to convert. Please replace myDate with your actual date variable. The resulting unixTimestampMilliseconds will be in the format you can use in your URL.
Make sure to adjust the code based on your actual Harbour date handling methods, as it may vary depending on the context of your project.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 58 guests