H hanyelmehy Active Member Licensed User Longtime User Aug 31, 2024 #1 how to Change First Day of week in short when use DateTime.GetDayOfWeek(Tick) in saturday for example must return 1 not 7
how to Change First Day of week in short when use DateTime.GetDayOfWeek(Tick) in saturday for example must return 1 not 7
H hanyelmehy Active Member Licensed User Longtime User Aug 31, 2024 #3 aeric said: View attachment 156508 Click to expand... its B4A library Upvote 0
aeric Expert Licensed User Longtime User Aug 31, 2024 #4 hanyelmehy said: its B4A library Click to expand... I think you can also use it in B4J. Else, just create a sub like this: B4X: ' Return the day of week from ticks ' Values are between 1 to 7, where 1 means Saturday. Sub DayOfWeek (Ticks As Long) As Int Dim Day As Int = (DateTime.GetDayOfWeek(Ticks) + 1) Mod 7 Return IIf(Day = 0, 7, Day) End Sub Upvote 0
hanyelmehy said: its B4A library Click to expand... I think you can also use it in B4J. Else, just create a sub like this: B4X: ' Return the day of week from ticks ' Values are between 1 to 7, where 1 means Saturday. Sub DayOfWeek (Ticks As Long) As Int Dim Day As Int = (DateTime.GetDayOfWeek(Ticks) + 1) Mod 7 Return IIf(Day = 0, 7, Day) End Sub