Extract day name from date feild in form

Hi There,

I have a form where users could change some values and some value’s are labeled. the only see the value but can’t change it.

One of this fields is a date. I would like to show the day name instead of the date.
i tried sc_date_conv but somehow the dayname format (dddd) is not giving the right format.

i tried another field and labeled it

{LESDAG} = sc_date_conv({wk_datum_gesprek}, “dd/mm/aaaa”, “dddd”);

still no result
Any idea?

To get the fullname of the day you can use

{LESDAG} = date(‘l’, strtotime({wk_datum_gesprek}));

Ah thanks. that was indeed what i’m looking for except that the day is now shown in english. I have to tinker a bit to get it in dutch… and i don’t know how.

i used this
setlocale(LC_ALL, ‘nl_NL’);
date_default_timezone_set(“Europe/Amsterdam”);

but can’t get i to work

It should be working!

You can also translate it yourself using

{LESDAG} = date(‘w’, strtotime({wk_datum_gesprek}));

It will return the number of the day instead, 0 (for Sunday) through 6 (for Saturday). Then use an array to return the locale day name

You’re my hero. it al works now. I was looking to deep in to this one. sometimes another look of somebody helps a lot.

For those who search for this answer. here’s my final solution.

$les_dag = date('w', strtotime({wk_datum_gesprek}));

switch ($les_dag) {
case “1”:
{LESDAG} = “maandag”;
break;
case “2”:
{LESDAG} = “dinsdag”;
break;
case “3”:
{LESDAG} = “woensdag”;
break;
case “4”:
{LESDAG} = “donderdag”;
break;
case “5”:
{LESDAG} = “vrijdag”;
break;
case “6”:
{LESDAG} = “Container 1”; // used to stock lessons normally saterday
break;
case “0”:
{LESDAG} = “Container 2”; // used to stock lessons normally sunday
break;
}