Closed AliEasy closed 3 years ago
Hi, The problem is that shamsi_date does not store time data, so does not have time zones and ... For example in one part of world we may be in some day and in other part in another day ... And shamsi_date does not have any preference in time zones. So converting from DateTime will loose some information ... This approach I think is misleading. What's your opinion ?
I'll add extension functions for DateTime, so yo can simply write: DateTime.parse(string).toGregorian() Or DateTime.parse(string). toJalali()
@AliEasy
And there is also a plan to add efficient parsers for shamsi_date. Which does not need time zone and time data ... But it is in its very early stages ... And I have lots of confusion about that too 😅 I'll be appreciated if you give me any comments ... @AliEasy
Yeah I noticed it today when I was trying to get DateTime from toDateTime()
:)
But in my case I need only the date not the time so I guess sth like DateTime.parse(string).toJalali()
would do the job for now.
Hi, I have added extension methods for DateTime on master branch. I'll be appreciated if you check them out to see if it have what you needed. Sorry for being so late ... @AliEasy
Hi, I'll close this issue. If you feel your problem is not solved, please reopen this issue. @AliEasy
Hi To get Gregorian from
DateTime
I have to useDateTime date = DateTime.parse(dateString);
first and then useJalali.fromDateTime(dateTime);
It will be easier to have a shortcut for that.