← Back to list

timestamp-standard
by TrueNine
⭐ 1🍴 1📅 Dec 3, 2025
SKILL.md
name: timestamp-standard description: Frontend-backend time data transmission standard, using millisecond timestamps for time points (timezone-independent); Duration/Period use ISO 8601 string format.
Time Representation Standard
Time Point (Instant)
| Type | Format | Description |
|---|---|---|
| Time Point | number | Millisecond timestamp, UTC-based, timezone-independent |
Core Principles:
- All time points use millisecond timestamps (Unix Epoch Milliseconds)
- Timestamps are timezone-independent, frontend converts display based on user timezone
- Database storage, API transmission, frontend-backend interaction all use numeric type
Duration
| Type | Format | Example | Description |
|---|---|---|---|
| Duration | string | PT1H30M | ISO 8601 duration format |
Duration Format: PT[n]H[n]M[n]S
PT1H- 1 hourPT30M- 30 minutesPT1H30M- 1 hour 30 minutesPT45S- 45 secondsPT1H30M45S- 1 hour 30 minutes 45 seconds
Period
| Type | Format | Example | Description |
|---|---|---|---|
| Period | string | P1Y2M3D | ISO 8601 date period format |
Period Format: P[n]Y[n]M[n]D
P1Y- 1 yearP2M- 2 monthsP3D- 3 daysP1Y2M3D- 1 year 2 months 3 days
Usage Examples
Interface Definition
interface Event {
createdAt: number // 1732608000000
updatedAt: number // 1732694400000
duration: string // "PT2H30M"
validPeriod: string // "P1Y"
}
Frontend Conversion
// timestamp to local display
const display = new Date(timestamp).toLocaleString()
// local time to timestamp
const timestamp = new Date().getTime()
Backend Processing (Kotlin/Java)
// Instant and timestamp conversion
val instant = Instant.ofEpochMilli(timestamp)
val timestamp = instant.toEpochMilli()
// Duration parsing
val duration = Duration.parse("PT1H30M")
// Period parsing
val period = Period.parse("P1Y2M")
Design Philosophy
- Timestamps: Numeric type for efficient transmission, no timezone ambiguity, cross-language compatible
- Duration/Period: ISO 8601 standard format, clear semantics, native parsing support
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon