Magic Cloud

An Open Source Application Generator


Magic Lambda Dates

Date manipulation slots for Magic. More specifically, this project contains the following slots.

Notice - Internally in Magic, everything is UTC Universal timezone, implying if you want to render it in user’s timezone, you’ll have to convert it explicitly in your client/frontend. All dates and times internally in Magic, also those stored into any database, are treated as UTC timezone. All dates transmitted to the backend, is also assumed to be UTC. This is to make things simple in regards to interacting with database systems, that may or may not add support for timezone offsets.

Below is an example of taking the current date and time, and adding two days and one second to it, for then to format the result as a string.

math.add
   date.now
   time
      days:2
      second:1
date.format:x:-
   format:"yyyy-MM-dd HH:mm:ss"

Project website

The source code for this repository can be found at github.com/polterguy/magic.lambda.dates, and you can provide feedback, provide bug reports, etc at the same place.

Quality gates

License

This project is the copyright(c) 2020-2021 of Thomas Hansen thomas@servergardens.com, and is licensed under the terms of the LGPL version 3, as published by the Free Software Foundation. See the enclosed LICENSE file for details.