Home > Net >  Can anyone help me with a BS to AD date converter for flutter?
Can anyone help me with a BS to AD date converter for flutter?

Time:01-23

I am looking to input my user birth date with in BS date format. BS date is useful date format in nepal.

What I want is to store:

2078-10-09 (nepali date)

CodePudding user response:

you can use https://pub.dev/packages/nepali_utils flutter package for nepali date.

In your pubspec.yaml file

dependencies:
  nepali_utils: ^3.0.3

Then,

import 'package:nepali_utils/nepali_utils.dart';

//parse date 
NepaliDateTime gorkhaEarthQuake = NepaliDateTime.parse('2072-01-12T11:56:25');
print(gorkhaEarthQuake.year); // 2072

NepaliDateTime currentTime = NepaliDateTime.now();
print(currentTime.toIso8601String()); //2076-02-01T11:25:46.490980
print(gorkhaEarthQuake.mergeTime(10, 20, 30));
// 2072-01-12 10:20:30.000

Similarly, use this package for:

NepaliDateTime DateConversion NepaliDateFormat NepaliNumberFormat NepaliUnicode NepaliMoment many yet to come

  •  Tags:  
  • Related