File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -593,6 +593,18 @@ void main() {
593593 // or get it in seconds or milliseconds
594594 print(Jalali.now().time.inSeconds);
595595 print(Jalali.now().time.inMicroseconds);
596+
597+ // example two:
598+ String format3(Date d) {
599+ final f = d.formatter;
600+
601+ return '${f.yyyy}-${f.mm}-${f.dd} ${f.tHH}:${f.tMM}:${f.tSS}.${f.tMSSS}';
602+ }
603+
604+ print(format3(Jalali.now()));
605+ // prints for ex. 1404-02-12 14:44:13.879
606+ print(format3(Gregorian.now()));
607+ // prints for ex. 2025-05-02 14:44:13.879
596608}
597609```
598610
Original file line number Diff line number Diff line change @@ -244,4 +244,16 @@ void main() {
244244 // or get it in seconds or milliseconds
245245 print (Jalali .now ().time.inSeconds);
246246 print (Jalali .now ().time.inMicroseconds);
247+
248+ // example two:
249+ String format3 (Date d) {
250+ final f = d.formatter;
251+
252+ return '${f .yyyy }-${f .mm }-${f .dd } ${f .tHH }:${f .tMM }:${f .tSS }.${f .tMSSS }' ;
253+ }
254+
255+ print (format3 (Jalali .now ()));
256+ // prints for ex. 1404-02-12 14:44:13.879
257+ print (format3 (Gregorian .now ()));
258+ // prints for ex. 2025-05-02 14:44:13.879
247259}
You can’t perform that action at this time.
0 commit comments