cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a 13-bit timestamp

czzzh
Explorer
0 Kudos

When I try to get the timestamp, I find that the time error is quite large,

Is there any good way to share?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

alan_chen03
Participant
0 Kudos

Hi 致弘,

How and where do you get the timestamp?

Kindly provide detailed steps to reproduce the issue.

Alan

czzzh
Explorer
0 Kudos

Hi Alan,

I get the timestamp in SDK,the code is as follows:

var ztime = (Context.GetCurrentSystemTimeStamp()).RoundToString(0);

var epochstart = "19700101000000";

var epochdate = GlobalDateTime.ParseFromString(epochstart).AddDuration(ABSL:Duration.ParseFromString("PT8H")).Delta(GlobalDateTime.ParseFromString(ztime)).ConvertToMinutes();

var ztimeStamp = epochdate * 60000;

My time zone is UTC+8,

If you have any suggestions or ideas, please let me know.

Thank you!