From da5228ac4a716734a0756905aa3ea4a39c85f6ac Mon Sep 17 00:00:00 2001 From: Masashi Umezawa Date: Sat, 3 Feb 2024 23:26:02 +0900 Subject: [PATCH] Changed MpSqPortableUtil >> timestampFromSeconds: seconds nanos: nanoSeconds --- .../DateAndTime.extension/instance/setNanoSeconds..st | 3 --- .../DateAndTime.extension/properties.json | 3 --- .../instance/timestampFromSeconds.nanos..st | 6 +++--- 3 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 repository/MessagePack-Squeak-Core.package/DateAndTime.extension/instance/setNanoSeconds..st delete mode 100644 repository/MessagePack-Squeak-Core.package/DateAndTime.extension/properties.json diff --git a/repository/MessagePack-Squeak-Core.package/DateAndTime.extension/instance/setNanoSeconds..st b/repository/MessagePack-Squeak-Core.package/DateAndTime.extension/instance/setNanoSeconds..st deleted file mode 100644 index dd6a193..0000000 --- a/repository/MessagePack-Squeak-Core.package/DateAndTime.extension/instance/setNanoSeconds..st +++ /dev/null @@ -1,3 +0,0 @@ -*MessagePack-Squeak-Core -setNanoSeconds: nanoSeconds - nanos := nanoSeconds \ No newline at end of file diff --git a/repository/MessagePack-Squeak-Core.package/DateAndTime.extension/properties.json b/repository/MessagePack-Squeak-Core.package/DateAndTime.extension/properties.json deleted file mode 100644 index 2237b11..0000000 --- a/repository/MessagePack-Squeak-Core.package/DateAndTime.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "DateAndTime" -} \ No newline at end of file diff --git a/repository/MessagePack-Squeak-Core.package/MpSqPortableUtil.class/instance/timestampFromSeconds.nanos..st b/repository/MessagePack-Squeak-Core.package/MpSqPortableUtil.class/instance/timestampFromSeconds.nanos..st index 270fc07..d0e6c7f 100644 --- a/repository/MessagePack-Squeak-Core.package/MpSqPortableUtil.class/instance/timestampFromSeconds.nanos..st +++ b/repository/MessagePack-Squeak-Core.package/MpSqPortableUtil.class/instance/timestampFromSeconds.nanos..st @@ -1,6 +1,6 @@ actions timestampFromSeconds: seconds nanos: nanoSeconds - | ts | - ts := DateAndTime fromSeconds: seconds + 2177452800 offset: 0. - nanoSeconds > 0 ifTrue: [ ts setNanoSeconds: nanoSeconds]. + | microseconds ts | + microseconds := (seconds * 1000000) + (nanoSeconds * 0.001). + ts := DateAndTime utcMicroseconds: microseconds offset: 0. ^ts \ No newline at end of file