• Stars
    star
    66
  • Rank 468,167 (Top 10 %)
  • Language
    Erlang
  • License
    MIT License
  • Created over 12 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NIF-based date and time parsing and formatting for Erlang

tempo Build Status

Authors: Dmitry Groshev ([email protected]), Sergei Levedev ([email protected]).

tempo is a library for parsing and formatting dates in Erlang. It provides a clean and nice interface to libc's strptime and strftime functions, which are unfortunately missing from Erlang's standard library.

Yes.

The only two functions you have to remember are tempo:parse/2 and tempo:format/2. Here are some examples:

1> {ok, Bin} = tempo:format(iso8601, {now, now()}).
{ok,<<"2016-01-11T19:25:26Z">>}
2> tempo:parse(iso8601, {datetime, Bin}).
{ok,{{2016,1,11},{19,25,26}}}

As you might have noticed, both of the functions follow a common pattern -- Format first, then a Value, tagged by its actual or expected type. Predefined formats include: iso8601, rfc1123, and rfc2822, but in fact, you can use any format, as long as it follows libc conventions:

(tempo_dev@localhost)1> {ok, Bin} = tempo:format(<<"%A, %Y-%d-%m">>, {now, now()}).
{ok,<<"Thursday, 2012-07-06">>}

Unfortunately, dealing with time on various platforms is messy, so limitations are unavoidable. Here's a shortlist of those we know of:

  • Parsing years before 1900 causes a {error, format_mismatch} on OS X.

Modules

tempo

More Repositories

1

pyte

Simple VTXXX-compatible linux terminal emulator
Python
606
star
2

sql-battleships

[Community] Play Battleships on PostgreSQL
PLpgSQL
184
star
3

yawndb

In-memory circular array database
Erlang
127
star
4

terraform-examples

Terraform manifests examples for different Selectel services
HCL
50
star
5

alberto

A simple OCaml library for writing Erlang port drivers
OCaml
42
star
6

terraform-provider-selectel

Terraform Selectel provider
Go
42
star
7

serverless_telegram_bot_example

Example of Telegram bot based on Selectel Serverless Functions
Python
33
star
8

pat

Pat, the only SMTP postman!
Erlang
23
star
9

yaml-config

Configuration management with YAML
Haskell
22
star
10

mirror-sync

Collection of scripts for linux rpm/deb repositories mirroring
Shell
21
star
11

hen

Haskell bindings to Xen hypervisor interface
Haskell
17
star
12

jane

JS's Acknowledgement of Native Erlang types
17
star
13

pyxs

Pure Python bindings to XenStore
Python
15
star
14

ansible-selvpc-modules

[Official] Ansible modules for Selectel Cloud
Python
13
star
15

cert-manager-webhook-selectel

Selectel DNS cert-manager ACME webhook
Go
13
star
16

go-selvpcclient

A Go library for the Selectel VPC API
Go
9
star
17

ifstop

display 'top' of network interfaces in system ordered by bps or pps (packets per second).
Python
9
star
18

ftpbench

Benchmark for load testing FTP servers
Python
8
star
19

kubernetes-examples

Examples for Selectel Managed Kubernetes Service.
8
star
20

domains-go

Go SDK for Selectel Domains API
Go
7
star
21

python-selvpcclient

[Official] Python client (lib + cli) for Selectel Cloud Management API.
Python
7
star
22

selectel-infra-examples

Selectel some examples of terraform modules
HCL
7
star
23

mks-go

Go SDK for Managed Kubernetes Service
Go
6
star
24

serverless_functions_examples_python

Python
6
star
25

ssh_pub_key_validation

SSH public key validation (coffeescript)
CoffeeScript
6
star
26

get-metar-weather

Create your own METAR&TAF weather Telegram-bot
Python
5
star
27

etsdangerous

An Erlang port of itsdangerous
Erlang
5
star
28

photo-gallery

Selectel storage photo gallery
CoffeeScript
5
star
29

docker-machine-driver

Selectel VPC driver for Docker Machine
Go
5
star
30

iam-go

Go SDK for Selectel IAM API
Go
5
star
31

serverless-python

Python SDK for Selectel Serverless Functions
Python
4
star
32

vhd-low-level

VHD low level utilities
Python
3
star
33

secretsmanager-go

Go
3
star
34

selectel-ml

[Official] Docker files to create a containeer with Python ML frameworks
Python
3
star
35

terraform-provider-selvpc

DEPRECATED in favour of: https://github.com/terraform-providers/terraform-provider-selvpc
Go
2
star
36

dbaas-go

[Official] Go SDK for Managed Databases Service
Go
2
star
37

centos-cron-randomization

Scripts and package to randomize exact time of execution of cron.hourly, daily, weekly and montly to reduce load spikes.
Shell
2
star
38

craas-go

Go SDK for Container Registry Service
Go
2
star
39

pi4_pxe_buildroot

buildroot image for custom (by custom dhcp option 224) pxe autoinstall
Makefile
1
star
40

kea-hook-remote_options

kea hook repo for selectel publishing
C++
1
star
41

mks-csi-snapshotter

1
star
42

timecard

Python
1
star
43

xs-tail

'tail' for XenStore events
Python
1
star
44

ipsec-vpn-demo

This repository contains information for DEMO on webinar 26.04.2022
Shell
1
star