News

moodlite - Coming soon


Timezone for next release code modification

marky · 305

marky

  • Newbie
  • *
    • Posts: 11
    • Likes: +1/-0
    • View Profile
on: February 25, 2019, 05:51:47 PM
Hey, I'v play with time to set it up to my timezone I would like to include a way to choses a timezone in the config. Also I would like to have the possiblility to know if it worked witht he time showing in the web interface

what need to be changed

---------------------ORIGINAL------------------------ line 300 to 310------------
 Ntp Server
 Time zones
 Central European Time (Frankfurt, Paris)
 Central European Summer Time
TimeChangeRule tchrCest = { "CEST", Last, Sun, Mar, 2, 120 };
 Central European Standard Time
TimeChangeRule tchrCet = { "CET", Last, Sun, Oct, 3, 60 };
Timezone tzCe(tchrCest, tchrCet);
TimeChangeRule *tcr;

----------------ALSO at line 2300-----------------
      utc = epoch;
      localTime = usEastern.toLocal(utc, &tcr); //the usEastern would have to be define and changed

---------------Modified one____________________
//-- Modification time zone--

#define timezone          EST       //the timezone are CEST,, EST,...


If timezone= EST
  #define TimeChangeRule usEDT = {"EDT", Second, Sun, Mar, 2, -240};  //UTC - 4 hours
  #define timechangerule usEST = {"EST", First, Sun, Nov, 2, -300};   //UTC - 5 hours
  #define usEastern(usEDT, usEST);
  #thisValue usEastern.toLocal(utc, &tcr)

also something like

utc = now();  //current time from the Time Library
eastern = usEastern.toLocal(utc);

utc = epoch;
      localTime = ThisValue.toLocal(utc, &tcr); //the usEastern would have to be define and changed

Would that be possible ? for future update

also just have it show up the current time on the server by the time chosing thing on the web interface.

« Last Edit: February 25, 2019, 09:23:35 PM by marky »



kripo

  • Newbie
  • *
    • Posts: 20
    • Likes: +0/-0
    • View Profile
Reply #1 on: February 26, 2019, 09:19:50 AM
wouldnt something like this in adittion to the timezome make sense for the moodlite?

https://github.com/dmkishi/Dusk2Dawn



spigot

  • Global Moderator
  • Full Member
  • *****
    • Posts: 112
    • Likes: +24/-0
  • There's no place like 127.0.0.1
    • View Profile
Reply #2 on: February 27, 2019, 07:27:40 AM
Hi.

Showing actual time is already implemented in the new Web interface.
I think the best way to handle time/timezones would be thorough web interface. I'll try to look into it, it won't be a small change.



marky

  • Newbie
  • *
    • Posts: 11
    • Likes: +1/-0
    • View Profile
Reply #3 on: March 03, 2019, 08:32:16 AM
i got a better idee on how to code it we should play with the time variable like (-4h) instead of changing the zone



 


SMF spam blocked by CleanTalk