Message Boards Message Boards

0
|
2069 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Date objects seemed same are not equal

Posted 1 year ago

Hello, I find the dates that seemed the same in the Mathematica are not the same. What makes them different and how make them the same? For example:

DateObject[]

DateObject[{2022, 11, 14, 16, 34, 02}]

The results: enter image description here

POSTED BY: Zhenyu Zeng
2 Replies

I think DateObject[] is giving you a date stored internally with greater than one second accuracy. The compact form in which the date is displayed doesn't show the decimal places. Try wrapping AbsoluteTime[] around your answers and see if that is the same. Or better, FullForm[].

POSTED BY: Gareth Russell
Posted 1 year ago

Yes! You are right. Thanks.

POSTED BY: Zhenyu Zeng
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract