Author Topic: Server Date  (Read 839 times)

0 Members and 1 Guest are viewing this topic.

Offline rokas2491

  • Occasional poster
  • *
  • Posts: 9
    • View Profile
Server Date
« on: July 04, 2017, 02:14:26 PM »
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: 1899
    • View Profile
Re: Server Date
« Reply #1 on: July 04, 2017, 04:06:55 PM »
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: 635
  • present picture
    • View Profile
    • Admin
Re: Server Date
« Reply #2 on: September 30, 2017, 10:42:26 PM »
Mars <3
GOD CAN READ YOUR MIND