Skip to content

Instantly share code, notes, and snippets.

@jihchi
Last active February 11, 2025 10:32
Show Gist options
  • Save jihchi/1c673092c80e9d3e7c4c365b20c2b29a to your computer and use it in GitHub Desktop.
Save jihchi/1c673092c80e9d3e7c4c365b20c2b29a to your computer and use it in GitHub Desktop.
import { TZDate } from 'npm:@date-fns/tz';
import { UTCDate } from "npm:@date-fns/utc";
import * as DF from 'npm:date-fns';
console.log('Use `TZDate` or `UTCDate` for date construction. All `date-fn` utilities are available in `DF` (e.g. `DF.format()`)');
console.log('TZCDate: https://github.com/date-fns/tz');
console.log('UTCDate: https://github.com/date-fns/utc');
console.log('`date-fn` utilities: https://date-fns.org/docs/Getting-Started');
@jihchi
Copy link
Author

jihchi commented Dec 27, 2024

Getting Started

deno repl --eval-file="https://gist.githubusercontent.com/jihchi/1c673092c80e9d3e7c4c365b20c2b29a/raw/datefns.ts"
Deno 2.1.4
exit using ctrl+d, ctrl+c, or close()
> new TZDate()
2024-12-27T08:40:52.933Z { internal: 2024-12-27T10:40:52.933Z }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment