tbib_timezone_offset 0.0.1 copy "tbib_timezone_offset: ^0.0.1" to clipboard
tbib_timezone_offset: ^0.0.1 copied to clipboard

unlisted

This Package used for Get date time with offset to local time , format time or convert it to iso format with date phone without location and server time zone not in egypt

Tbib Timezone Offset #

This Package used for Get date time with offset to local time , format time or convert it to iso format with date phone without location and server time zone not in egypt

How to use

Let's see the mistakes we make constantly

  // when we convert date time to iso string
    log('date iso String wrong ${DateTime.now().toIso8601String()}');  
    // why this code above in wrong see print

    // 2023-07-14T12:09:07.700784
    // it not convert to iso string and add Z in the end see next code and log and don't remove two hours from egypt but add it as iso.

    log('date iso String correct ${DateTime.now().toUtc().toIso8601String()}');
    // why this code above in correct see print 

    // 2023-07-14T09:09:07.702586Z
    // it not convert to iso string and add Z in the end see next code

with this package add this methods to solve this issue from date time to string iso


// convert date time to correct iso string  with local time
    log("date time flutter ${DateTime.now().toIsoDateTimeLocalString}");


// convert date time to correct iso string  with utc time
    log("date time is ${DateTime.parse(DateTime.now().toIsoDateTimeLocalString).getLocalDateTime}");

with this package add this methods to solve this issue from string iso to date time

// convert date time time to string 
DateTime dateAustraliaString = DateTime.parse("2023-07-14 20:00:28.733182+10:00");
log("date time String egypt is  ${dateAustraliaString.isoDateTimeLocalString}");

Can format string date or date time to any format


var date = "2023-07-14 20:00:28.733182+10:00";

// or use 
var date = DateTime.parse("2023-07-14 20:00:28.733182+10:00");

date.formatDate("dd/MM/yyyy HH:mm:ss");

0
likes
0
points
150
downloads

Publisher

unverified uploader

Weekly Downloads

This Package used for Get date time with offset to local time , format time or convert it to iso format with date phone without location and server time zone not in egypt

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, intl, json_annotation

More

Packages that depend on tbib_timezone_offset