Files
bare-operating-system/packages/bare-os-seeder/kernel/bin/date
T
2026-04-02 22:43:46 -04:00

18 lines
455 B
Plaintext

/** Shared helpers for drive-resident /bin scripts (prepended before each command). */
function bareStdin(ctx) {
return typeof ctx.shellStdin === 'string' ? ctx.shellStdin : ''
}
async function run(ctx, argv) {
const utc = argv.includes('-u') || argv.includes('--utc')
const d = new Date()
ctx.console.log(
utc
? d
.toISOString()
.replace('T', ' ')
.replace(/\.\d{3}Z$/, ' UTC')
: d.toString()
)
}