Skip to content

Commit 5491e08

Browse files
committed
ADD some examples
1 parent d0512e2 commit 5491e08

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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

example/shamsi_date_example.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)