Comments (2)
isn't tzDate()
enough though? I asked similar question for UTC in an issue that I closed not long after getting more info from the author in this comment
So yes, if you want to create the utc time, in utc you can do
tzDate('2020-02-04', 'utc')
, but you can also dotzDate('2020-02-04T09:30', 'America/New_York')
which would return a Date object (utc timestamp) for 9:30am on Feb 4th, 2020 in new york.
see tzDate docs
from tempo.
Thank you. I'm primarily concerned with formatting the dates. All of my dates come from the server in UTC, but I always want them displayed in the website's local timezone (which may be different than the user's timezone).
That's why I think being able to set a default format (or display) timezone would be useful.
As it is now, I have to remember to set the timezone in every call to format()
(and there are many in this application we're building).
from tempo.
Related Issues (20)
- Bugfix deviceTZ undefined case error HOT 3
- Unnecessary code in bundles HOT 5
- Are there any plans to support timezone formats like +-HH:mm in the parse function?
- Feature Request: Difference between datetimes HOT 1
- format YYYY-MM returns YYYY-M HOT 3
- yearStart and yearEnd may need to be added to types - v0.1.15 HOT 2
- Feature request: weekNumber HOT 8
- Feature request: `differenceInMilliseconds` / `differenceInSeconds` / `differenceInMinutes` / etc. HOT 1
- FeatureReuet: Support for timezone format +-HH:mm in format token. HOT 1
- Filtering out year still includes comma HOT 2
- Invalid offset error for +0000 HOT 2
- Optional argument in `is*` functions HOT 3
- Format with `a` or `A` are different locally vs CI HOT 2
- When user timezone is `Europe/Lisbon`, the tempo's `range` function throws an "Invalid offset" exception. HOT 6
- Feature Request : Duration format HOT 1
- Error: Invalid time zone specified: Etc/Unknown HOT 1
- "diffMinutes does not exist" error HOT 3
- Old timezones require second precision HOT 1
- Issue : format function throw error when locale passed including numbering system ( ar-u-nu-arab )
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tempo.