Beitrag
Teile dein Wissen.
Can you get a timestamp when an object is created in Move?
Hey there! I'm working with Move and I'm curious if it's possible to get a timestamp of when an object is created. I've seen something about using sui::clock to capture this, but I was wondering if there's a native way to access this timestamp directly in Move code without additional attributes or if we can avoid additional computations. Any insights?
- Move CLI
- Move
Antworten
2Sie können den Zeitstempel während der Erstellung des Objekts als Attribut mit sui: :clock erfassen, wie timestamp_ms. Diese Methode beinhaltet das Hinzufügen eines Attributs zum Speichern von 'time_ms' aus dem gemeinsam genutzten Clock-Objekt.
Der direkte Zugriff auf Zeitstempel in Move, ohne Attribute hinzuzufügen, wird von Natur aus nicht unterstützt. Der beste Ansatz scheint darin zu bestehen, das gemeinsam genutzte Clock-Objekt zu verwenden oder auf Transaktionsdaten nach der Erstellung zu verweisen.
Weißt du die Antwort?
Bitte melde dich an und teile sie.