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
| Modifier and Type | Member | Description |
|---|---|---|
| public static readonly property | nownow as Timestamp: |
Returns the current time in seconds since the Epoch (January 1st, 1970, 00:00:00 UTC). |
| public readonly property | totalSecondstotalSeconds as Double: |
Total seconds since Unix epoch. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Timestamp | Constructs a Timestamp object with a given value. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | toDateTime | Converts this Timestamp to a DateTime object. |
| public override | toStringtoString() as String: |
Returns a string representation of this Timestamp object. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static | operator+(first as Timestamp, duration as Duration) as Timestamp: | No summary. |
| public static | operator-(first as Timestamp, duration as Duration) as Timestamp: | No summary. |
| public static | operator-(first as Timestamp, second as Timestamp) as Duration: | No summary. |