rejetto forum

Server Date

0 Members and 1 Guest are viewing this topic.

Offline rokas2491

  • Occasional poster
  • *
    • Posts: 9
    • View Profile
Hi,
I do not know where to ask this question any other place than here.
I'm using this code:

</style>


<strong class="GeneratedText">
    <script type="text/javascript">
        document.write("<p>");
        var day = new Date();
        var weekday = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
        var d = weekday[day.getDay()];
        var hr = day.getHours();
if (d=="Monday" && hr==0) {
document.write(" New Musikk");
}
if (d=="Monday" && hr==1) {
document.write(" New Musikk ");
}
if (d=="Monday" && hr==2) {
document.write(" New Musikk ");
}
if (d=="Monday" && hr==3) {
document.write(" New Musikk ");
}
        document.write("</p>");
    </script>
</strong>



Problem is that this code uses user time, but not mine. How can I make so this code uses server date or my time zone, my time zone is (UTC+1).
Thank You ::) ::) ::) ::) ::) ::)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
uses TIME macro

{.time | A .}

    returns current time information. The format is specified by optional parameter A. Refer to this page for format syntax. If A is not supplied, value "c" will be used.
    Optional parameter when to specify a time other than current.
    Optional parameter offset to specify the number of days differing from the current time.


Offline Fysack

  • Tireless poster
  • ****
    • Posts: 598
  • present picture
    • View Profile
    • Admin