Date & Time Literals

Published: 2021-09-16
Discussion on: Acmion (on this website), or Reddit.

Nearly all programming languages feature literals for a multitude of data types, but support for date and time literals is very rare at the least. However, such literals could provide certain benefits.

Some examples of literals used in "real world" programming languages:

int_literal    = 0
float_literal  = 0.0f
string_literal = "Hello world"
list_literal   = [ 1, 2, 3 ]
object_literal = { a = 1, b = 2, c = "hello" }

A potential date and time literal syntax:

time = <18:12:57.89>
date = <2021-09-16>
time_zone = <+01:00>
time_zone_region <us/pacific>

date_time = <2021-09-16 18:12:57.89>
date_time_zone = <2021-09-16 18:12:57.89 +01:00>
date_time_zone_region = <2021-09-16 18:12:57.89 us/pacific>

interpolated_date_time_zone_region = <@date @time @time_zone_region>

The motivation behind this is that one would not have to depend on certain imported or global functions or constructors to create relatively widely used data types. For example, few if any programming languages, require the following declaration for integers: i = new int(1). Additionally, in the name of consistency one could define literals for all of the most basic data types (ints, floats, lists, dicts, objects, etc.).

This would not only be a nice feature in a programming language, but also in a separate serialization format. For example, how does JSON serialize dates? The answer is as strings, but this is quite an error prone approach. Certain languages even default to using strings as dates (or maybe its just the programmers that use strings for convenience), which is also quite problematic.

Maybe this will someday be implemented more widely in existing programming languages.

Discussion

Discuss this post here! You may also discuss it on or Reddit.

Post a Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.
Henrycam (2022-05-15 18:26:26 UTC)

Make money 24/7 without any efforts and skills. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-17 07:21:00 UTC)

Small investments can bring tons of dollars fast. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-09 14:31:39 UTC)

# 1 financial expert in the net! Check out the new Robot. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-26 00:03:43 UTC)

One click of the robot can bring you thousands of bucks. https://breweriana.it/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-02 23:48:17 UTC)

Launch the financial Robot and do your business. https://2f-2f.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-22 20:49:17 UTC)

Automatic robot is the best start for financial independence. https://get-profitshere.life/?u=bdlkd0x&amp;o=x7t8nng

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-08 00:50:15 UTC)

Making money is very easy if you use the financial Robot. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
hafTaitte (2022-03-02 08:21:52 UTC)

This condition may be congenital appear at birth can occur with aging or may be associated with stroke cerebrovascular accident cranial nerve damage and other neurologic disorders. Rqreze https://oscialipop.com - cheap cialis This type of acidosis is usually caused when the body is unable to remove enough carbon dioxide through breathing. Bryvma <a href="https://oscialipop.com">Cialis</a> Wkmbqj Tocita https://oscialipop.com - cialis generic online Xwtltl Amoxicillin For Dogs Colds

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-11 01:25:58 UTC)

The best online investment tool is found. Learn more! https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-22 00:01:15 UTC)

The financial Robot is your # 1 expert of making money. https://get-profitshere.life/?u=bdlkd0x&amp;o=x7t8nng

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-15 03:30:55 UTC)

Looking forward for income? Get it online. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-16 05:13:54 UTC)

Robot is the best way for everyone who looks for financial independence. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-17 17:09:25 UTC)

Make thousands of bucks. Financial robot will help you to do it! https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
skyreveryres (2022-02-03 01:04:40 UTC)

https://www.skyrevery.ru/airplanes/pilatus-pc-12/ - Частный самолет Pilatus PC-12/47E (NG) (Пилатус 12) - SkyRevery - подробнее на нашем сайте https://skyrevery.ru - skyrevery.ru https://skyrevery.ru/ - Аренда частного самолета с экипажем в компании SkyRevery – это выбор тех, кто ценит свое время и живет по своему расписанию! Аренда частного самолета помогает экономить самый важный ресурс – время. Арендовав частный самолет, именно Вы решаете, когда и куда полетите. Для выполнения чартерных рейсов мы предлагаем частные самолеты иностранного производства, гарантирующие высокий уровень комфорта и безопасности полета. Внимательные бортпроводники и высокопрофессиональные пилоты сделают Ваш полет максимально приятным и удобным. Когда Вам нужна https://skyrevery.ru/ - аренда самолета срочно, мы можем организовать для Вас вылет по готовности от 3 часов с момента подтверждения.

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-29 23:38:54 UTC)

The huge income without investments is available. https://2f-2f.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-15 23:43:23 UTC)

The online income is your key to success. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-30 15:44:20 UTC)

Let your money grow into the capital with this Robot. https://2f-2f.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-11 11:22:04 UTC)

The financial Robot is your # 1 expert of making money. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-27 07:43:46 UTC)

Looking for an easy way to make money? Check out the financial robot. https://breweriana.it/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-26 20:47:22 UTC)

No need to work anymore. Just launch the robot. https://breweriana.it/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-05-16 04:38:30 UTC)

Robot never sleeps. It makes money for you 24/7. https://cam.187sued.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.
Henrycam (2022-04-27 23:26:10 UTC)

Everyone can earn as much as he wants now. https://2f-2f.de/gotodate/promo

Reply to Comment

Error! Incorrect value.
Note: Commenting is completely anonymous, thus, comments can not be edited.

Report Comment

Error! Incorrect value.