From: Wolfgang Denk Date: Fri, 03 Aug 2018 15:17:37 +0200 Subject: [U-Boot] Get number of seconds since beginning of epoch In-Reply-To: References: Message-ID: <20180803131737.070F2240062@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hallo Mark, In message you wrote: > > 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. There is no such feature in U-Boot (yet). > Alternative proposals how to fulfill the requirement within U-Boot are we= lcome, too. =E2=98=BA There is no trivial way, as such information is not stored in typich RTCs; it has to be computed from the information we have. The algorithm could be copied from existing code (GNU or BusyBox date command for example) and added as an (optional, i. e. configurable) extension to the U-Boot date command. Note that such an extension would have to store the result in an environment variable, as we don't have command substituation or such in U-Boot's shells. You know where you can ask for help :-) Best regards, Wolfgang Denk --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A failure will not appear until a unit has passed final inspection.