Repository
Current version released
2 years ago
ndate script
Date format to console.
Usage: ndate [-] [--zero] [--date-style <full|long|medium|short>] [--time-style <full|long|medium|short>]
[--time-zone <time-zone>] [--local <locale>] [--template <template>]
[--json] [--epoch] [--epoch-ms] [--date <date>] [--help] [-j] [-d <date>]
[-l <locale>] [-z] [-h]Please install with deno:
deno install https://deno.land/x/ndate/ndate.tsSamples use:
ndate # Tuesday, October 11, 2022 at 5:59:37 PM Chile Summer Time
ndate --local es-CL # martes, 11 de octubre de 2022, 17:59:14 hora de verano de Chile
ndate --local en-CL # Tuesday, October 11, 2022 at 5:59:37 PM Chile Summer Time
ndate --time-zone Asia/Tokyo --local en-US # Thursday, July 13, 2023 at 6:46:21 AM Japan Standard Time
LANG=en-US ndate --time-zone Asia/Tokyo # Thursday, July 13, 2023 at 6:46:21 AM Japan Standard Time
LANG=en-US TZ=Asia/Tokyo ndate # Thursday, July 13, 2023 at 6:46:21 AM Japan Standard Time
echo 2022-10-12T05:39:19.678Z | ndate - # Wednesday, October 12, 2022 at 2:39:19 AM Chile Summer Time
ndate -j # 2022-10-12T05:40:33.246Z
ndate --epoch # 1689255846
ndate --epoch-ms # 1689255823663
ndate --epoch-ms -z # 1689255823663%
ndate --template '{{utc_full_year}}-{{utc_month:padStart:2:0}}-{{utc_date:padStart:2:0}}' # 2023-06-13Options to --template
{{epoch}}: Date on unix time (It measures time by the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970){{epoch_ms}}: Date on unix time (It measures time by the number of milliseconds that have elapsed since 00:00:00 UTC on 1 January 1970){{json}}: Time on ISO 8601 (Alias of{{iso8601}}){{iso}}: Time on ISO 8601 (Alias of{{iso8601}}){{iso8601}}: Time on ISO 8601{{utc}}: Date in the RFC 7231 format (Alias of{{rfc7231}}){{rfc7231}}: Date in the RFC 7231 format{{time}}: Result ofdate.getTime(){{full_year}}: Result ofdate.getFullYear(){{utc_full_year}}: Result ofdate.getUTCFullYear(){{month}}: Result ofdate.getMonth(){{utc_month}}: Result ofdate.getUTCMonth(){{date}}: Result ofdate.getDate(){{utc_date}}: Result ofdate.getUTCDate(){{day}}: Result ofdate.getDay(){{utc_day}}: Result ofdate.getUTCDay(){{hours}}: Result ofdate.getHours(){{utc_hours}}: Result ofdate.getUTCHours(){{minutes}}: Result ofdate.getMinutes(){{utc_minutes}}: Result ofdate.getUTCMinutes(){{seconds}}: Result ofdate.getSeconds(){{utc_seconds}}: Result ofdate.getUTCSeconds(){{milliseconds}}: Result ofdate.getMilliseconds(){{utc_milliseconds}}: Result ofdate.getUTCMilliseconds(){{timezone_offset}}: Result ofdate.getTimezoneOffset(){{local}}: Result ofIntl.DateTimeFormat.format{{local_day}}:daypart ofIntl.DateTimeFormat{{local_dayPeriod}}:dayPeriodpart ofIntl.DateTimeFormat{{local_era}}:erapart ofIntl.DateTimeFormat{{local_hour}}:hourpart ofIntl.DateTimeFormat{{local_literal}}:literalpart ofIntl.DateTimeFormat{{local_minute}}:minutepart ofIntl.DateTimeFormat{{local_month}}:monthpart ofIntl.DateTimeFormat{{local_second}}:secondpart ofIntl.DateTimeFormat{{local_timeZoneName}}:timeZoneNamepart ofIntl.DateTimeFormat{{local_weekday}}:weekdaypart ofIntl.DateTimeFormat{{local_year}}:yearpart ofIntl.DateTimeFormat
Sample
ndate --template '{{utc_full_year}}-{{utc_month}}-{{utc_date}}' # 2023-6-13