API to get day of week? (Monday, Tuesday, etc)

Hi, I am building an app that shows users a lost of activities happening on a. certain day of the week (such as a recurring event that happens every Tuesday).

Is there a public/open source API I can use to get the current day of the week? I know this would be based on timezones ultimately but I am sure it is possible. I use an API that grabs my IP address and knows what country I’m in, so I assume this would be possible too.

I have been looking everywhere for a solution but cannot seem to find a public/open source API to fetch the current day of the week. Could anyone point me in the right direction?

1 Like

Make your own, it is pretty simple.

4 Likes

Hi @sladerose,

Just in case: you may not need an API for that.

Option 1: you can use value from Date & Time → Current Time, formatted as Day of Week. With this you get day name (e.g. Monday, Tuesday, …). Then you can use various ways to set up further logic based on that.
NB: this works if your users use one language, because formatted value will depend on user’s device language settings (e.g. different for English, French, …)

Option 2: you can determine the day of week ID using several math formulas. See the post here How to derive weekdays from a date and here Show information exclusively on a specific day of the week.

Best,
Victor.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.