using System; namespace Qrakhen.Qamp.Core.Values.Objects; public class Timestamp(Value timeStamp) : Native(nameof(Timestamp)) { public static readonly string DefaultFormat = "H:m:s d.M.y"; // cheap ass workaround i know private DateTime _dateTime = new DateTime(timeStamp.Signed * 10); public Value Raw = timeStamp; public Value Format(Value? format = null) { return String.Make(_dateTime.ToString(format?.Ptr.As()?.Value ?? DefaultFormat)); } public override string ToString() => ToString(true); public string ToString(bool detail) => detail ? $"[Timestamp <{_dateTime}>]" : _dateTime.ToString(DefaultFormat); }