Feb 13, 2014 Replies: 4 This is a B4J library which can be used to get current time of day, month, year, calculated days forwards, backwards, sideways(just kidding) current day by number of days in the year current month number current year number also date string example 13/02-2014 Thursday 10:19:55,701 etc. There are bugs still to be worked out. Any suggestions just let me know. Thanks (This library is a GNU License the author is Jacob Dreyer) Attachments JGetTime.zip JGetTime.zip 8.4 KB · Views: 1,065 Click to expand...
This is a B4J library which can be used to get current time of day, month, year, calculated days forwards, backwards, sideways(just kidding) current day by number of days in the year current month number current year number also date string example 13/02-2014 Thursday 10:19:55,701 etc. There are bugs still to be worked out. Any suggestions just let me know. Thanks (This library is a GNU License the author is Jacob Dreyer)
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2014 #2 Why do you need it? DateUtils + DateTime should provide all these features. Note that the GNU license is very restricting.
Why do you need it? DateUtils + DateTime should provide all these features. Note that the GNU license is very restricting.
giga Well-Known Member Licensed User Longtime User Feb 14, 2014 #3 Erel, DateUtils + DateTime does allot of these features, The main reason I use it is because of the Leap Year check and add/subtract random number of min/hours/days/months ability that produces a string Date. Since you say the GNU license is more restricted do you recommend I remove this from the forum? Thanks
Erel, DateUtils + DateTime does allot of these features, The main reason I use it is because of the Leap Year check and add/subtract random number of min/hours/days/months ability that produces a string Date. Since you say the GNU license is more restricted do you recommend I remove this from the forum? Thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2014 #4 DateUtils supports both of these features. Check DateUtils.AddPeriod and DateUtils.NumberOfDaysInMonth. Code: Sub IsLeapYear(year As Int) As Boolean Return DateUtils.NumberOfDaysInMonth(2, year) = 29 End Sub It is fine to put it in the forum. You should however include the source code and any developer using this library will also need to open source his project.
DateUtils supports both of these features. Check DateUtils.AddPeriod and DateUtils.NumberOfDaysInMonth. Code: Sub IsLeapYear(year As Int) As Boolean Return DateUtils.NumberOfDaysInMonth(2, year) = 29 End Sub It is fine to put it in the forum. You should however include the source code and any developer using this library will also need to open source his project.
giga Well-Known Member Licensed User Longtime User Feb 14, 2014 #5 Thanks Erel for the guidance. I will try this and upload the source code. Attachments Time java source code.txt Time java source code.txt 21.9 KB · Views: 1,021