I see a lot of posts in this forum explaining how to do this, but I can’t get mine to work right. My variable DateTime is of type System.DateTime. That variable is converting a string to a date/time. I am trying to get DateTime to show as milliseconds.
@Josh_James You just want to convert your datetime value to milliseconds? can you clarify a bit? When you convert datetime to milliseconds, it will be in long format. You can treat it as text or string that also works. is there a specific reason why you are trying to store it in datetime variable? ConvertToMilliSec.zip (2.4 KB)
To simply convert datetime to millisec the uploaded package works
Hi @Josh_James
Assuming you have a DateTime variable named “DateTime”. Create a Long variable named "milliseconds"with DataType: System.Int64 and give below condition.
Hello @Athira - This is great, thank you for this! Do you know how to make this work without the timestamp? Just get the milliseconds of the date itself?
@Josh_James the same would work for date also. Incase you have a datime value and you want to get the date only you can do it in many ways. You can use convert.tostring(“yourformat”) or for datetime variable variable.date should also return the date. You can check the uploaded file as a sample ConvertToMilliSec.zip (2.4 KB)