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 :: convert datetime to TZDateTimeflutter 
Dart :: flutter containerborder 
Dart :: flutter mouse tracker error 
Dart :: dart list of maps 
Dart :: flutter crop captured image 
Dart :: flutter text in row not wrapping 
Dart :: flutter logo duration 
Dart :: inkwell splash color not working flutter 
Dart :: dart fixed length list 
Dart :: how to color text in flutter 
Dart :: how to create space between list on flutter 
Dart :: difference between hot reload and hot restart in flutter 
Dart :: ruby on rails db migrate 
Dart :: crossaxisalignment.stretch row in column flutter 
Dart :: how to get current timezone flutter 
Dart :: Try adding a case clause for the missing constant, or adding a default clause.dartmissing_enum_constant_in_switch. 
Dart :: how to center widgets in using scrollview flutter 
Dart :: vxstate listen not working flutter 
Dart :: const issue on new flutter version 
Dart :: flutter download file 
Swift :: swift ui open link in browser 
Swift :: swift continue 
Swift :: add buton border swift 
Swift :: date formatter swift 
Swift :: button sizetofit not working swift 
Swift :: Fetch class from userdefaults ios swift 
Swift :: swift clear badge number 
Swift :: swift round double to 2 decimal places 
Swift :: how to style textfield swiftui 
Swift :: swift date to string 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =