Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter date with timezone

/// converts [date] into the following format: `2020-09-16T11:55:01.802248+01:00`
static String formatISOTime(DateTime date) {
  var duration = date.timeZoneOffset;
  if (duration.isNegative)
  	return (date.toIso8601String() + "-${duration.inHours.toString().padLeft(2, '0')}:${(duration.inMinutes - (duration.inHours * 60)).toString().padLeft(2, '0')}");
  else
  	return (date.toIso8601String() + "+${duration.inHours.toString().padLeft(2, '0')}:${(duration.inMinutes - (duration.inHours * 60)).toString().padLeft(2, '0')}");
}
Comment

PREVIOUS NEXT
Code Example
Dart :: hive dart type adapter 
Dart :: tab splash hide flutter 
Dart :: flutter constructors keep properties private with constructor 
Dart :: geturedetector flutter 
Dart :: how to iterate object in dart 
Dart :: creating a clas in dart 
Dart :: dart operator ?? 
Dart :: flutter force soft keyboard on widget 
Dart :: arrow upwars button flutter 
Dart :: dart int to str 
Dart :: const issue on new flutter version 
Dart :: dart print multiply 
Dart :: flutter display alert dialog after server error 
Swift :: swiftui center image 
Swift :: navigationview hide header swiftui 
Swift :: swiftui color picker 
Swift :: play sound swift stack overflow 
Swift :: swift compare string to button title 
Swift :: uicollectionview detect scroll swift 
Swift :: iOS 10.3.1 Simulator manually 
Swift :: xcode disable a button 
Swift :: swift create array from range 
Swift :: index string swift 
Swift :: navigation title bar color swftui 
Swift :: change font of substring swift 
Swift :: add navigation bar button swiftui 
Swift :: set white place holder color in swift 
Swift :: uitextview text alignment 
Swift :: UIFont.init bold 
Swift :: Create a Swift Array 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =