Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [solved] Playing with time
Forum Update on Monday, May 27th 2025

[solved] Playing with time

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Merinas
    wrote on 30 Mar 2011, 08:19 last edited by
    #1

    Hi,

    I haven't seen any function to play with time, i wonder if is it possible. What i'm looking for is some funtions like that :
    

    @if(time1.isbefore(time2)) ...
    var intVar = time1.secTo(time2) ....@

    In a same way is there any function for handling string like find, substr or charAt ? It would prevent me from reinventing the wheel and creating a C++ extension for so few. Or at least, is it possible to create a library of functions accessible from javascript without creating QML object? Because as far as I understood it we can only register qml type.

    Thanks in advance.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      frankcyblogic.de
      wrote on 30 Mar 2011, 13:07 last edited by
      #2

      It's just standard EcmaScript. All standard objects are available. Take look at the "Mozilla Reference":http://developer.mozilla.org/en/JavaScript/Reference . For instance @(new Date()).getTime())@ delivers the number of miliseconds since begin of Epoch.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Merinas
        wrote on 31 Mar 2011, 12:31 last edited by
        #3

        Thanks a lot. That would be great if this information was on the doc.

        1 Reply Last reply
        0

        1/3

        30 Mar 2011, 08:19

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved