Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Lua Date, Time, month code shortcuts


AutoFrank

Recommended Posts

Hi,

Was searching to display the date and time parts and came across this 

Please login or register to see this code.

and used on conjunction with the normal os.date you can display/use any part of a date/time

Please login or register to see this code.

gives

Please login or register to see this code.

and the time is 

Please login or register to see this code.

might save other newbee's like myself from too much head scratching

 

-Frank

  • Like 2
Link to comment
Share on other sites

nice find. Thank you

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> I think i found some uses for %w

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> 

Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...

Hi Frank or everyone else :)

 

I was wondering if you have experience or solution in doing a "calculation" with the following example as I like to reduce (or extend) the sunriseHour value with e.g. one hour ? (sunriseHour2 = sunriseHour - ????)

 

sunriseHour = fibaro:getValue(1,'sunriseHour')  

 

 

Link to comment
Share on other sites

38 minutes ago, Patrick said:

Hi Frank or everyone else :)

 

I was wondering if you have experience or solution in doing a "calculation" with the following example as I like to reduce (or extend) the sunriseHour value with e.g. one hour ? (sunriseHour2 = sunriseHour - ????)

 

sunriseHour = fibaro:getValue(1,'sunriseHour')  

 

 

 

I could me miles away but was just looking at "sunriise sunset" vd part of @Sankotronic "timed based events"scene set up

The vd looks like it has the calculation your looking for on the sunrise +.- button

just a long shot

Id copy and paste it but you prob get it more in context if you downloaded it

Edited by Jamie mccrostie
Link to comment
Share on other sites

  • Topic Author
  • 12 minutes ago, Jamie mccrostie said:

     

    I could me miles away but was just looking at "sunriise sunset" vd part of @Sankotronic "timed based events"scene set up

    The vd looks like it has the calculation your looking for on the sunrise +.- button

    just a long shot

    Id copy and paste it but you prob get it more in context if you downloaded it

     

     

    @Jamie mccrostie

     

    yes, your correct. His code does this calculation and also has multiple examples of time compare/adjustment 

    Link to comment
    Share on other sites

    • 1 year later...

    The topic has been moved from "

    Please login or register to see this link.

    " to "

    Please login or register to see this link.

    ".

     

    Temat został przeniesiony z "

    Please login or register to see this link.

    " do "

    Please login or register to see this link.

    ".

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...