Create automated, scripted timers on the fly as needed
With , you can create custom countdown on the fly directly within your website using PHP, Javascript or other programming languages.
If you're not sure what this means, please ask a programmer / webmaster to build one for you. This is more advanced.
This allows you for example to run a events website and have a script (ex: PHP) read from a database all the events and then create on the fly countdown timers for them to display on your pages. This is much faster and more convenient than doing them one by one by hand!
NOTE: You'll need to create a FREE account to use this feature!Here is a full example of the code you need on your website to show a custom timer.
REPLACE "XXXX" with the appropriate value as explained below:
Here is a functionning example:
http://amazingtimer.com/widgets/widgets.php?k=XXXXXXXXXXDEMOXXXXXXXXXXXXXXXX&countdown_date=20250914&countdown_time=1514&tz=America.New_York&title=This%20is%20a%20scripted%20countdown
&desc=Demonstration%20of%20an%20automated%20countdown%20timer&show_date=1
&img_url=http%3A%2F%2Famazingtimer.com%2Fimages%2Fb36.jpg&img_overlay=0&color_background=000000&color_title=ffffff
&color_date=ffffff&color_time=ffffff
Here are the url & query parameters for the API:
PARAMETER | EXAMPLE | VALID VALUES | NEEDED? | DESCRIPTION |
---|---|---|---|---|
k | k=XXXXXXXXXXXXXXXXXXXXXXXXXXX | Your account key | MANDATORY | This is your account key. NOTE: Plesae Log in here and go to 'My Profile' to get your account key. |
tz | tz=America.New_York | Refer to this page for valid time zones | OPTIONAL Default: your profile time zone |
Get a valid timezone from this page. MUST be EXACTLY as written on that page. |
countdown_date | countdown_date=20241231 | Format: YYYYmmdd | MANDATORY | The date you want to count down to in this format, with no spaces or other characters in between: YYYYmmdd.
4 digits year (ex: 2024), 2 digits month with leading zero (ex: 01), 2 digits day with leading zero (ex: 08) |
countdown_time | countdown_time=2305 | Format: HHii | MANDATORY | The time you want to count down to in this format, with no spaces or other characters in between: HHii.
2 digits hour in 24-hour format with leading zero (ex: 23), 2 number minutes with leading zero (ex: 05). NOTE: to convert 12 hour into 24-hour format, just add 12 to the hour if "PM" otherwise leave as is. Ex: if it's 2:35 pm, add 12 and it becomes 1435 |
title | title=Apple%20September%20Event%21 | Text encoded for URL | OPTIONAL Default: empty |
The title of your countdown. May be left empty if you just want the countdown timer.
IMPORTANT: use rawurlencode() if using PHP or similar functions to encode text for URLs if using other programming languages |
desc | desc=Apple%20is%20expected%20to%20launch%20the%20all-new%20iPhone%2017%21%20Stay%20tuned%20for%20more%20info%20on%20the%20event%20right%20here | Text encoded for URL | OPTIONAL Default: empty |
The description of your countdown. May be empty.
IMPORTANT: use rawurlencode() if using PHP or similar functions to encode text for URLs if using other programming languages |
show_date | show_date=1 | 1 = show date 0 = don't show date |
OPTIONAL Default: 1 |
Show date + time that we are counting down to under the title |
img_url | img_url=http%3A%2F%2Fdomain.com%2Ffolder%2Fmy_image_file.jpg | encoded URL, .JPG or .PNG image ONLY | OPTIONAL Default: no image, we use the background color |
FULL URL to .JPG or .PNG image file, including "http://" (ex: "http://domain.com/folder/my_image_file.jpg")
IMPORTANT: use rawurlencode() if using PHP or similar functions to encode URLs if using other programming languages |
img_overlay | img_overlay=1 | 0 = NO overlays, 1 = BLACK 80% opacity overlay, 2 = WHITE 80% opacity overlay |
OPTIONAL Default: 1 (black overlay) |
You may add a black or white 80% opacity overlay to your image to make it look nicer and easier to read. You may also use none. |
color_background | color_background=F1F1F1 | 6 character hexadecimal color code | OPTIONAL Default: 000000 (black) |
Background color to use if you have no image. Hexadecimal color code without "#" |
color_title | color_title=0101AA | 6 character hexadecimal color code | OPTIONAL Default: FFFFFF (white) |
Text color of the title. Hexadecimal color code without "#" |
color_date | color_date=0101AA | 6 character hexadecimal color code | OPTIONAL Default: FFFFFF (white) |
Text color of the date. Hexadecimal color code without "#" |
color_time | color_time=0035AA | 6 character hexadecimal color code | OPTIONAL Default: FFFFFF (white) |
Text color of the time. Hexadecimal color code without "#" |