Jump to content
Guides for the Forum Read more... ×
Poradniki na Forum Read more... ×
AutoFrank

Lua Date, Time, month code shortcuts

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

Share this post


Link to post
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/smile@2x.png 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/smile@2x.png 2x" width="20" height="20" /> 

Share this post


Link to post
Share on other sites

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')  

 

 

Share this post


Link to post
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

Share this post


Link to post
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 

    Share this post


    Link to post
    Share on other sites

    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.

    ".

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    ×