convert date to timestamp
Hi world,
in my application i want compare the timestamp values to date field values ,
my database countains many records with their corresponding timestamps values: in this form (" 2017-05-17T13:45:40").
{"profile_id":"9XOzzcI8NfSUjxAhEt0cTLRejwmp6HPi","biometrics":[{"timestamp":"2017-05-17T13:45:40","utc_offset":"+02:00","resting_heartrate":120.0,"spo2":98.0,"activity_id":"591c540aac8f295479ee14ce"}]}
i've also a small database as a patient program wich has a date in this form : 2017-09-25 11:00:00
so , my question is : i want to extract a pairs of (profile_id, timestamp) with the recent timestamps value as condition
after i compare timestamp value to a date values in my second database
i found also that timestamp and date don't have a same form (i want to convert date de timestamps form in green).
thank you.
Doesn't the answer to your previous question at https://community.intersystems.com/post/convert-timestamp-its-correspond... help you here?
HI Rubens,
i'm new developper here, and when the answer is ok , i evoluate it with green flag.
* Sighs *
Keep creating posts with similar meaning and you'll get downvoted quickly. Although we are here to help you, you could at least try using the search feature and also recompensate us by checking the correct answer.
Hello Soufiane, although your thank you is appreciated, an acceptance check is even more, because it alerts users with the same issue as you that a solution has been provided already.
https://community.intersystems.com/post/convert-timestamp-its-correspond...
You'll also help us if you use the same thread whenever you think about making a similar post. Don't create new threads if your subject is the same as the one you already created, or the community will start downvoting you.
Remember that downvoted threads have less chance of getting attention.
To add to John's post. That earlier post lets you convert the timestamp to a matching format that you can then get out of your current database as follows:
$zdatetime($h,3,1)
Or convert the timestamp into an internal date format with $zdatetimeh.