Time and Date Rust API
libtad-rs is a Rust library for accessing Time and Date API services.
An access key and a secret key is required to use the API. For more information, see our API Services page.
Cargo features
- "sync-client": Enabled by default.
- "async-client": Disabled by default.
"async-client" can be enabled by disabling default features and adding "async-client" as a feature.
Astronomy API
Astro Event Service
Get astronomical events for multiple places and objects:
let client = new;
let request = new
.with_object
.with_object
.with_placeid
.with_placeid
.set_startdt;
let response = client.get_astro_events;
Astro Position Service
Get astronomical data for multiple places and objects:
let request = new
.with_object
.with_placeid
.with_placeid
.with_interval
.with_interval;
let response = client.get_astro_position;
Date Calculator API
Business Date Service
Calculate a business date by adding days to a given date:
let request = new
.set_placeid
.set_startdt
.with_days;
let response = client.calculate_business_date;
Calculate a business date by subtracting days to a given date:
let request = new
.set_placeid
.set_startdt
.with_days
.set_subtraction;
let response = client.calculate_business_date;
Business Duration Service
Calculate duration between two timestamps:
let request = new
.set_placeid
.set_startdt
.set_enddt;
let response = client.calculate_business_duration;
Holidays API
Get all holidays for a year and one or multiple countries:
let request = new
.with_country
.with_country
.set_year;
let response = client.get_holidays;
On This Day API
Get events on this day:
let request = new;
let response = client.get_events_on_this_day;
Get events for a given month and day:
let request = new
.set_month
.set_day;
let response = client.get_events_on_this_day;
Filter events by event type:
let request = new
.with_type
.with_type;
let response = client.get_events_on_this_day;
Places API
Get all places:
let request = new;
let response = client.get_places;
Query for a place:
let request = new
.set_query
.set_qlimit;
let response = client.get_places;
Tides API
Get tidal data for one or multiple places:
let request = new
.with_placeid
.with_placeid;
let response = client.get_tidal_data;
Time API
ConvertTime Service
Convert time from a location to multiple locations:
let request = new
.set_fromid
.with_toid
.with_toid
.set_datetime;
let response = client.convert_time;
DSTList Service
Get all daylight saving times:
let request = new;
let response = client.get_daylight_savings_time;
Get daylight saving times for a specific year:
let request = new.set_year;
let response = client.get_daylight_savings_time;
Timeservice Service
Get current time for a place:
let request = new
.set_placeid;
let response = client.get_current_time;