B4J Question Change First Day of week

hanyelmehy

Active Member
Licensed User
Longtime User
how to Change First Day of week
in short when use DateTime.GetDayOfWeek(Tick) in saturday for example must return 1 not 7
 

aeric

Expert
Licensed User
Longtime User
its B4A library
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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…