Android Question get weekday from date or epochdate

RushilD

Member
Licensed User
Hi All,

Is there a way to get weekday ("Monday", tuesday ) etc from date or epochdate.

For example I have a json that contains

B4X:
            "Date": "2022-08-15T07:00:00+02:00",
                                "EpochDate": 1660539600,
and I would like to shows MON in a label instead of 22-08-15

Any suggestions or examples on how I could do this ? I searched a lot on the forums and couldn't find
 

Alexander Stolte

Expert
Licensed User
Longtime User
The answer was in front of you all the time
B4X:
Dim Date As Long = DateUtils.UnixTimeToTicks(colDailyForecasts.Get("EpochDate")) 'The Date in Ticks
Log(DateUtils.TicksToString(Date)) 'Ticks to string
Log(DateUtils.GetDayOfWeekName(Date)) 'Weekday Name
 
Upvote 1
Top