Rootless

Automate iOS, iPadOS, and macOS using plain JavaScript. Build custom widgets and interact directly with native APIs.

Download on the App Store
Rootless app interface

Plain JavaScript

Supports ES6. Scripts are stored as plain .js files on your disk.

Native APIs & Documentation

Integrate directly with iOS native APIs. Fully documented, available offline.

Siri Shortcuts

Trigger scripts via Siri. Present tables, websites, and custom HTML natively.

System Integration

Run from the Share Sheet, process inputs, and manage local files via Files.app.

x-callback-url

Communicate seamlessly and trigger workflows with other apps on your device.

Customizable & Ready

Tailor the code editor to your liking. Includes several example scripts to start immediately.

Documentation

Also inside the app, or as rootless.json.

DateTime

Date and time creation, parsing, and manipulation

Dates and times. Static methods make one, instance methods compare, format and do arithmetic.

Properties

yearNumber

Year component

monthNumber

Month component (1-12)

dayNumber

Day of month

hourNumber

Hour component (0-23)

minuteNumber

Minute component (0-59)

secondNumber

Second component (0-59)

weekdayString

Day name ("sunday" to "saturday")

Methods

.format(pattern)String

Format this date using a pattern (e.g. 'yyyy-MM-dd HH:mm').

  • pattern String required
.relative()String

Get a relative time string (e.g. '2 hours ago').

.isBefore(other)Boolean

Check if this date is before another.

.isAfter(other)Boolean

Check if this date is after another.

.isSameDay(other)Boolean

Check if this date is the same day as another.

.add(duration)DateTime ›

Add a duration to this date.

.subtract(duration)DateTime ›

Subtract a duration from this date.

.difference(other)Duration ›

Get the duration between this date and another.

DateTime.now()DateTime ›

Get the current date and time.

DateTime.today()DateTime ›

Get today's date at midnight.

DateTime.parse(isoString)DateTime ›

Parse an ISO 8601 date string.

  • isoString String required
DateTime.from(options)DateTime ›

Create a date from components: { year, month, day, hour, minute, second }.

  • options Any required

    Anything left out defaults to the current value for that component.

    • year Number

      Defaults to the current year.

    • month Number

      1 to 12.

    • day Number

      1 to 31.

    • hour Number

      0 to 23.

    • minute Number

      0 to 59.

    • second Number

      0 to 59.

Examples

Current date & formatting

const now = DateTime.now();
const formatted = now.format("MMM d, yyyy");
// "Mar 13, 2026"

Parsing & comparison

const date = DateTime.parse("2026-01-01");
const today = DateTime.today();
console.log(date.isBefore(today)); // true

Date arithmetic

const tomorrow = DateTime.now()
  .add(Duration.days(1));
const diff = tomorrow.difference(DateTime.now());
console.log(diff.inHours); // ~24