PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi! I still consider myself a noob in programming, but what I want to do is to convert a script that is on a site I run from Java to php (if it's even possible to get the same function).
The script looks like this
<script>
function date ()
{
var date=new Date ();
var year=date.getYear (), month=date.getMonth (), day=date.getDate ();
return day+'/'+(month+1)+' Anno '+(year-1994);
}
</script>
I'd really appreciate if someone could help me with this function.
Make sure you understand that moving date/time related code to server from client will make it use server timezone, whereas previously it used client timezone. You will need to either account for client timezone settings in your code or accept the fact the code will not (in general case) function identically due to the changed environment.
andym01480: That's the kind of function I'm looking for but instead of the output being "22/5/14" I'd like the output to be "22/4 Anno 14"
What would this code look like? Like I stated previously I concider myself to be a real noob in programming, so any help writing the code would be appreciated.
Thank you for the help, I'll try the script tonight sometime to se the outcome and thereafter decide if I'm still going to use it or not.. The big reason why I don't want to use Java anymore is probably quite obvious.
The site I'm running is for a medieval society and we have our own timeline and this function is supposed to show the visitor what date it is according to our timeline.