akushwarrior / instant Goto Github PK
View Code? Open in Web Editor NEWA package that exports functions for converting, formatting, and nicening of dates/times in Dart.
Home Page: https://pub.dev/packages/instant
License: MIT License
A package that exports functions for converting, formatting, and nicening of dates/times in Dart.
Home Page: https://pub.dev/packages/instant
License: MIT License
In the timezone.dart file, the map entry 'CET' is missing. There is only the 'CEST' to be found.
When I have a time of 12:50 (24 hour time format) it shows it as 12:50 AM which is 0:50 in 24 hour time format... Please fix this issue when you can. It's a pretty simple one as well.
All the classes I can find seem to do a 'conversion' of a local datetime to a specific zone.
I know the time in the zone I just need to create a DateTime instance from that.
Essentially I have a time in a string:
2020-10-27 06:10:05+00:00
I need to parse the string into a datetime.
I'm currently doing
expiryDate = DateTime.parse('2020-10-27 06:10:05+00:00');
But I would like to do something like:
DateTime dt = dateTimeWithZone(2020, 10, 27, 06, 10, 05, 'GMT');
DateTime myDT = DateTime.now();//Current DateTime
print("current time :- ${myDT}");
//current time :- 2022-03-24 17:44:12.158026
DateTime EST = dateTimeToZone(zone: "EST", datetime: myDT);//DateTime in EST zone
print("EST time :- ${EST}");
//EST time :- 2022-03-24 07:14:12.158026Z
this is my code. And right now I check EST zone time on Google it's 8:14 .
Why I m getting difference?
plugin deosnt support certain timezones like wat
I have a datetime in gmt and need to print it out in the local timezone.
I thought I could do something like:
var gmtTime = DateTime.parse('2020-10-27 06:10:05+00:00');
var offset = DateTime.now().timeZoneOffset; /// this is a duration
dateTimeToOffset(datetime: expiryDate, offset: offset) // this is a double?
I'm really not a big fan of using doubles as the lack a unit.
Dart has really formalised Duration so I would expect this type of library to also use it.
The above impedance mismatch also causes problems.
The doco also doesn't state what unit the double is in. I'm guessing its hours?
I end up with:
var gmtTime = DateTime.parse('2020-10-27 06:10:05+00:00');
var offset = DateTime.now().timeZoneOffset; /// this is a duration
var hours = offset.inHours + offset.inMinutes / 60;
dateTimeToOffset(datetime: expiryDate, offset: hours) // this is a double?
But given the library is meant to make things easier ;<
When daylight savings are changed. it does not change the date.
i had used with EDT time zone
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.