BitsAndBytes Active Member Licensed User Dec 9, 2016 #1 I want to create a report between the first day of current year and the last date of the current year and store those on 2 long variables as ticks. How i will create those 2 dates dynamical? Thank you
I want to create a report between the first day of current year and the last date of the current year and store those on 2 long variables as ticks. How i will create those 2 dates dynamical? Thank you
M Mahares Expert Licensed User Longtime User Dec 9, 2016 #2 B4X: Log(DateTime.DateParse("1/1/" & DateTime.GetYear(DateTime.Now))) Log(DateTime.DateParse("12/31/" & DateTime.GetYear(DateTime.Now))) 'Second line can be 31/12 depending on your date format EDIT: I should mention that you can also use DateUtils library and use this code to return the same result: B4X: Log($"${DateUtils.SetDate(DateTime.GetYear(DateTime.Now),1,1)}"$ ) Log($"${DateUtils.SetDate(DateTime.GetYear(DateTime.Now),12,31)}"$ ) Last edited: Dec 9, 2016 Upvote 0
B4X: Log(DateTime.DateParse("1/1/" & DateTime.GetYear(DateTime.Now))) Log(DateTime.DateParse("12/31/" & DateTime.GetYear(DateTime.Now))) 'Second line can be 31/12 depending on your date format EDIT: I should mention that you can also use DateUtils library and use this code to return the same result: B4X: Log($"${DateUtils.SetDate(DateTime.GetYear(DateTime.Now),1,1)}"$ ) Log($"${DateUtils.SetDate(DateTime.GetYear(DateTime.Now),12,31)}"$ )