Timestamp
classin packageklyn.time
public class Timestamp extends Object implements ValueType:
Represents a point in time, typically expressed as the number of seconds since the Epoch (January 1st, 1970, 00:00:00 UTC).
This class extends the Double class to provide timestamp functionality.
It includes methods to get the current timestamp, convert to DateTime, and provide a string representation.
import klyn.time
timestamp = Timestamp.now
print(timestamp) # Output: Timestamp(1693459200.0)
@since 1.0
Properties
| Modifier and Type |
Member |
Description |
| public static readonly property |
now |
Returns the current time in seconds since the Epoch (January 1st, 1970, 00:00:00 UTC). |
| public readonly property |
totalSeconds |
Total seconds since Unix epoch. |
Constructors
| Modifier and Type |
Member |
Description |
| public |
Timestamp |
Constructs a Timestamp object with a given value. |
Methods
| Modifier and Type |
Member |
Description |
| public |
toDateTime |
Converts this Timestamp to a DateTime object. |
| public override |
toString |
Returns a string representation of this Timestamp object. |
Operators