Documentation ¶
Index ¶
- Constants
- func EndOfMonth(year, month int) int
- func EndOfWeek(e time.Weekday) int
- func IsBissextil(year int) bool
- func Now() (d Date, c Clock)
- func NowIn(dd Duration) (d Date, c Clock)
- type Clock
- func (c Clock) Add(d Duration) (r Clock, ok bool)
- func (c Clock) Clock() (hour, min uint)
- func (c1 Clock) Compare(c2 Clock) int
- func (c1 Clock) Diff(c2 Clock) Duration
- func (c Clock) Format(sep string) string
- func (c Clock) IsNil() bool
- func (c Clock) String() string
- func (c Clock) Sub(d Duration) (Clock, bool)
- type Date
- func (t Date) Add(d Duration) (r Date, ok bool)
- func (d1 Date) Compare(d2 Date) int
- func (d Date) Date() (year, month, day int)
- func (d1 Date) Diff(d2 Date) Duration
- func (d Date) Eom() Date
- func (d Date) Eow() Date
- func (d Date) Format(seps ...string) string
- func (d Date) IsNil() bool
- func (d Date) String() string
- func (t Date) Sub(d Duration) (r Date, ok bool)
- type Duration
- type Unit
Constants ¶
View Source
const ( NoUnit Unit = iota Minute Hour Day Week Month Year DurationNil Duration = 0 )
Variables ¶
This section is empty.
Functions ¶
func IsBissextil ¶
IsBissextil retourne vrai si l’année fournie en paramètre est bissextile
Types ¶
type Clock ¶
type Clock uint
Clock représente une heure donnée
const ( ClockBegin Clock = 0 ClockEnd Clock = 60*24 - 1 ClockNil = ^ClockBegin )
func ClockNowIn ¶
func NewClock ¶
NewClocek retourne une heure avec le nombre d’heures et de minutes donnés en paramètre
func ParseClock ¶
ParseClock parse une string en heure. La string doit être sous la forme hhmm ou hh?mm (? étant un caractère)
type Date ¶
type Date int
Date représente une date
const (
DateNil Date = 0
)
func ParseDate ¶
ParseDate parse une string en date. La string doit être sous la forme YYYYMMJJ ou YYYY?MM?JJ (? étant un caractère)
type Duration ¶
type Duration int
Duration est une durée entre deux indications de temps
func NewDuration ¶
NewDuration retourne une durée avec sa valeur et son unité spécifiées
func ParseDuration ¶
ParseDuration convertit le paramètre donné en durée. Il doit être sous la forme nU où:
- n est un entier positif ou négatif,
- U l’unité parmi y, m, w, d, H ou M représentant respectivement l’année, le mois, la semaine, le jour, l’heure et la minute
Click to show internal directories.
Click to hide internal directories.