Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt Installer Script - How to get current date and time
Forum Updated to NodeBB v4.3 + New Features

Qt Installer Script - How to get current date and time

Scheduled Pinned Locked Moved Solved Installation and Deployment
2 Posts 2 Posters 526 Views 2 Watching
  • 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.
  • S Offline
    S Offline
    stvokr
    wrote on last edited by
    #1

    Hi everyone,

    I wonder how I can retrieve the current date and time in the installscript.qs.

    I want to backup an existing data folder with

    component.addOperation( "Execute", "tar", "cfz", dataFolder + ".tar.gz", dataFolder );
    

    and this solution already works. But now I want to add a date/time stamp before the extension, e.g. "dataFolder.2019-01-11_11-18-00.tar.gz" or as ISO-Date.

    Is there anyway to get the current date and time?

    regards
    Oliver

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      These scripts use a limited subset of JavaScript, you can try if JS Date works. API is described here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

      (Z(:^

      1 Reply Last reply
      1

      • Login

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