This topic is locked

Add the week day to a field

4/20/2007 4:03:47 AM
PHPRunner General questions
N
Norian author

Hello I have a requirement to add date, time and the weekday automatically to record, now I have the date & time sorted out, but cannot figure out how to add the day automatically i.e. field day want it to automatically put the day of the week in when the record is being added.
Many thanks in advance to anyone who can help <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=5055&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

N
Norian author 4/20/2007

Hmm maybe I did not explain this very well or maybe people think its too simple <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=17156&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' />
Basically on the record I have a field Day. When people enter a record they are manually having to put the day by selecting the value in a drop down list i.e. Monday, Tuesday, Wednesday etc.. I would like this to be entered automatically, so if someone is entering a record on tuesday the field Day will automatically be set with a value of Tuesday... is this possible?
Again many thanks.

T
thesofa 4/21/2007

Do you really need to do this as there are PHP functions which will extract the day iof the week from any date.

Have a look on W3 Schools here for info about using the date() function.

using date(D) will extract the day of the week from a date.

HTH

N
Norian author 4/22/2007

Do you really need to do this as there are PHP functions which will extract the day iof the week from any date.

Have a look on W3 Schools here for info about using the date() function.

using date(D) will extract the day of the week from a date.

HTH


Hello Sofa, thanks for the reply.. maybe its still a bit unclear what I am trying to do.
I have on the table a date field and time field which give the data and time stamps, but I also need to be able to see the day of the week on which the record was created clearly so the page looks something like:
Date of call: 22/04/2007

Time of call: 11:40

Day of call: Sunday
at the moment I cant figure out how to get the day of call to get the value automatically???
Any help very much appreciated

N
Norian author 4/22/2007

Got it working now thanks, for some reason date("D") was just leaving the field blank, I deleted the field from the database and recreated it and now its working fine... So it was nice and simple in the end <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=17171&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />