Help us shape the future of Go! Take the 2026 Go Developer Survey

rtime

package module
v0.0.0-...-2cf0588 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2015 License: MIT Imports: 2 Imported by: 4

README

russian-time

A tiny library to represent DateTime in russian language

Installation:

go get "github.com/ivahaev/russian-time"

Usage

import (
    "fmt"
    "github.com/ivahaev/russian-time"
    "time"
)
// Get current local DateTime
t := rtime.Now()
// Or if you are using time.Time object:
standardTime := time.Now()
t = rtime.Time(standardTime)

// Get full string representation:
fmt.Println(t.String())
// Шестнадцатое июня две тысячи пятнадцатого года, один час, тридцать шесть минут, тридцать три секунды

// Get date string representation:
fmt.Println(t.DateString())
// Шестнадцатое июня две тысячи пятнадцатого года

// Get time string representation:
fmt.Println(t.TimeString())
// Один час, тридцать шесть минут

// Get time with seconds string representation:
fmt.Println(t.TimeStringWithSeconds())
// Один час, тридцать шесть минут, тридцать три секунды
type Month
type Month time.Month

Base type for month

func (Month) String
func (m Month) String() (month string)

Returns string representation of Month

func (Month) StringInCase
func (m Month) StringInCase() (month string)

Returns representation of Month in case: Января, Декабря...

type Time
type Time time.Time

Base type for DateTime. Can be converted from time.Time

func Now
func Now() Time

Returns current DateTime

func (Time) DateString
func (t Time) DateString() (result string)

Returns date string representation of Time

func (Time) DayString
func (t Time) DayString() (result string)

Returns string representation of Day of Month

func (Time) Hour
func (t Time) Hour() int

Returns the hour within the day specified by t, in the range [0, 23].

func (Time) HourString
func (t Time) HourString() (result string)

Returns string representation of Hour

func (Time) Minute
func (t Time) Minute() int

Returns the minute offset within the hour specified by t, in the range [0, 59].

func (Time) MinuteString
func (t Time) MinuteString() (result string)

Returns string representation of Minute

func (Time) Month
func (t Time) Month() Month

Returns int month [0,12]

func (Time) Second
func (t Time) Second() int

Returns the second offset within the minute specified by t, in the range [0,59].

func (Time) SecondString
func (t Time) SecondString() (result string)

Returns string representation of Second

func (Time) String
func (t Time) String() (result string)

Returns full string representation of Time

func (Time) TimeString
func (t Time) TimeString() (result string)

Returns time string representation of Time without seconds

func (Time) TimeStringWithSeconds
func (t Time) TimeStringWithSeconds() (result string)

Returns time string representation of Time with seconds

func (Time) Weekday
func (t Time) Weekday() Weekday

Returns specifies a day of the week (Sunday = 0, ...).

func (Time) Year
func (t Time) Year() int
func (Time) YearString
func (t Time) YearString() (year string)

Returns string representation of Year

func (Time) YearStringInCase
func (t Time) YearStringInCase() (year string)

Returns string representation of Year in case: Двухтысячного года, Одна тысяча девятьсот четертого года

type Weekday
type Weekday time.Weekday

A Weekday specifies a day of the week (Sunday = 0, ...).

func (Weekday) String
func (w Weekday) String() (weekday string)

Returns string representation ofWeekday

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration time.Duration

A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years.

func (Duration) Hours

func (d Duration) Hours() float64

Hours returns the duration as a floating point number of hours.

func (Duration) Minutes

func (d Duration) Minutes() float64

Minutes returns the duration as a floating point number of minutes.

func (Duration) Nanoseconds

func (d Duration) Nanoseconds() int64

Nanoseconds returns the duration as an integer nanosecond count.

func (Duration) Seconds

func (d Duration) Seconds() float64

Seconds returns the duration as a floating point number of seconds.

func (Duration) String

func (d Duration) String() (result string)

Returns a string representation of the duration in russian language

func (Duration) StringApproximate

func (d Duration) StringApproximate() (result string)

Returns a string representation of the approximate duration in russian language

type Month

type Month time.Month

Base type for month

func (Month) String

func (m Month) String() (month string)

Returns string representation of Month

func (Month) StringInCase

func (m Month) StringInCase() (month string)

Returns representation of Month in case Января, Декабря...

type Time

type Time time.Time

Base type for DateTime. Can be converted from time.Time

func Now

func Now() Time

Returns current DateTime

func (Time) DateString

func (t Time) DateString() (result string)

Returns date string representation of Time

func (Time) DayString

func (t Time) DayString() (result string)

Returns string representation of Day of Month

func (Time) Hour

func (t Time) Hour() int

Returns the hour within the day specified by t, in the range [0, 23].

func (Time) HourString

func (t Time) HourString() (result string)

Returns string representation of Hour

func (Time) Minute

func (t Time) Minute() int

Returns the minute offset within the hour specified by t, in the range [0, 59].

func (Time) MinuteString

func (t Time) MinuteString() (result string)

Returns string representation of Minute

func (Time) Month

func (t Time) Month() Month

Returns int month [0,12]

func (Time) Second

func (t Time) Second() int

Returns the second offset within the minute specified by t, in the range [0, 59].

func (Time) SecondString

func (t Time) SecondString() (result string)

Returns string representation of Second

func (Time) String

func (t Time) String() (result string)

Returns full string representation of Time

func (Time) TimeString

func (t Time) TimeString() (result string)

Returns time string representation of Time without seconds

func (Time) TimeStringWithSeconds

func (t Time) TimeStringWithSeconds() (result string)

Returns time string representation of Time with seconds

func (Time) Weekday

func (t Time) Weekday() Weekday

Returns specifies a day of the week (Sunday = 0, ...).

func (Time) Year

func (t Time) Year() int

func (Time) YearString

func (t Time) YearString() (year string)

Returns string representation of Year

func (Time) YearStringInCase

func (t Time) YearStringInCase() (year string)

Returns string representation of Year in case Двухтысячного года, Одна тысяча девятьсот четертого года

type Weekday

type Weekday time.Weekday

A Weekday specifies a day of the week (Sunday = 0, ...).

func (Weekday) String

func (w Weekday) String() (weekday string)

Returns string representation ofWeekday

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL