From: Jonas Mark (BT-FIR/ENG1) Date: Fri, 3 Aug 2018 10:40:28 +0000 Subject: [U-Boot] Get number of seconds since beginning of epoch Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Hi, I am wondering whether U-Boot already has the functionality to retrieve the number of seconds since beginning of the 1970-01-01 epoch. I would like to use this value in a Hush script. For a product I have the requirement to detect if the current booting happens within x seconds of the last boot. I already have access to the system’s RTC and can read it with U-Boot’s date command. This returns the current date and time in a nice human readable format. I am now looking for something which would return a timestamp in seconds. I could then fulfill the afore mentioned requirement by calculating the difference between two timestamps using Hush and the let command. Alternative proposals how to fulfill the requirement within U-Boot are welcome, too. ☺ Best regards, Mark Building Technologies, Panel Software Fire (BT-FIR/ENG1) Bosch Sicherheitssysteme GmbH | Postfach 11 11 | 85626 Grasbrunn | GERMANY | www.boschsecurity.com Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart HRB 23118 Aufsichtsratsvorsitzender: Stefan Hartung; Geschäftsführung: Tanja Rückert, Andreas Bartz, Thomas Quante, Bernhard Schuster