D Declan Well-Known Member Licensed User Longtime User Apr 7, 2016 #1 How can I get the following dates: Yesterday Month To Date Last Month Last Month to Date Last Year Last Year to Date Last 7 days Last 30 days Last 60 days Last 90 days This Calendar Quarter This Calendar Quarter to Date Last Calendar Quarter Last Calendar Quarter to Date Last Year Calendar Quarter Last Year Calendar Quarter to Date
How can I get the following dates: Yesterday Month To Date Last Month Last Month to Date Last Year Last Year to Date Last 7 days Last 30 days Last 60 days Last 90 days This Calendar Quarter This Calendar Quarter to Date Last Calendar Quarter Last Calendar Quarter to Date Last Year Calendar Quarter Last Year Calendar Quarter to Date
fixit30 Active Member Licensed User Longtime User Apr 7, 2016 #2 You should take a look at the DateUtils library. https://www.b4x.com/android/forum/threads/dateutils-simplifies-date-and-time-calcuations.26290/ Upvote 0
You should take a look at the DateUtils library. https://www.b4x.com/android/forum/threads/dateutils-simplifies-date-and-time-calcuations.26290/
D Declan Well-Known Member Licensed User Longtime User Apr 7, 2016 #3 Thanks, I have looked at DateUtils. What I need to do is: Code: Copy NewDate = (DateTime.Date(DateTime.Now) - 1 day) etc. That would give me yesterday Upvote 0
Thanks, I have looked at DateUtils. What I need to do is: Code: Copy NewDate = (DateTime.Date(DateTime.Now) - 1 day) etc. That would give me yesterday
DonManfred Expert Licensed User Longtime User Apr 7, 2016 #4 Code: Copy Dim today As Long = DateTime.Now Dim p As Period p.Days = -1 Dim newdate As Long = DateUtils.AddPeriod(today,p) Log(DateTime.Date(newdate)) Note to check dateutils in libs tab Upvote 0
Code: Copy Dim today As Long = DateTime.Now Dim p As Period p.Days = -1 Dim newdate As Long = DateUtils.AddPeriod(today,p) Log(DateTime.Date(newdate)) Note to check dateutils in libs tab
D Declan Well-Known Member Licensed User Longtime User Apr 7, 2016 #5 DonManfred said: Code: Copy Dim today As Long = DateTime.Now Dim p As Period p.Days = -1 Dim newdate As Long = DateUtils.AddPeriod(today,p) Log(DateTime.Date(newdate)) Note to check dateutils in libs tab Click to expand... Many thanks Upvote 0
DonManfred said: Code: Copy Dim today As Long = DateTime.Now Dim p As Period p.Days = -1 Dim newdate As Long = DateUtils.AddPeriod(today,p) Log(DateTime.Date(newdate)) Note to check dateutils in libs tab Click to expand... Many thanks