in reply to Re: User's time
in thread User's time
Unless the time is largely used to determine the content, I would agree that you better get the date/time from the user's box. JavaScript is one way. To hardcode user date in the content makes the solution less portable. What if the user is traveling?
The following script displays date in dd/mm/yy format, you can easily change it to different formats:
<script language="JavaScript"> var date = new Date(); var d = date.getDate(); var day = (d < 10) ? '0' + d : d; var m = date.getMonth() + 1; var month = (m < 10) ? '0' + m : m; var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; document.write(day + "/" + month + "/" + year); </script>
|
|---|