Category : datetime

I’m trying to build an adaptative Date and Time Picker for Android and Ios, DateTimeField( controller: date, focusNode: _focusNodeDate, validator: (value){ if(value == null){ return ‘Ce champ est requis’; }; return null; }, decoration: InputDecoration( labelText: ‘Date de naissance’, labelStyle: TextStyle( fontSize: getProportionateScreenWidth(20), color: Colors.grey, ), ), format: format, onShowPicker: (context, currentValue) { if(Platform.isAndroid){ return ..

Read more

Here is my sample code return same date, I am trying to convert MST date & time to EST date & time, can anyone give me a suggestion. var input ="2021-03-05T14:14:27.99" val formatMST: DateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH) formatMST.timeZone = TimeZone.getTimeZone("MST") val formatEST: DateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH) formatEST.timeZone = TimeZone.getTimeZone("EST") val dateFormat: DateFormat = ..

Read more

I am having a method which formats my particular data string public static String dateFormatter(String dateToFormat){ SimpleDateFormat dateParser = new SimpleDateFormat("yyyy-MM-dd", Locale.UK); // All the fields in dateFormatter must be in dateParser SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy, MMM d, EEE", Locale.UK); Date date = new Date(); try { date = dateParser.parse(dateToFormat); } catch (ParseException e) ..

Read more