joda

package module
v0.0.0-...-0e768de Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: MIT Imports: 1 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Half-hearted Joda to Go Date Format Converter

The method of specifying dates in Go are based on a well-known date:

Mon Jan 2 15:04:05 MST 2006

Ref: https://golang.org/src/time/format.go

This library tries to use a more familiar method of specifying formats for dates:

Two digit year              y       06
Four digit year             Y       2006
Long month name             MMMM    January
Short month name            MMM     Jan
Two digit month             MM      01
Single digit month          M       1
Two digit day of month      dd      02
Single digit day of month   d       2
Long day of week            EE      Monday
Short day of week           E       Mon
Two digit 12 hours          hh      03
Single digit 12 hour        h       3
Two digit 24 hours          H       15
Two digit minutes           mm      04
Single digit minutes        m       4
Two digit seconds           ss      05
Single digit seconds        s       5
Milliseconds                S       .0
AM/PM                       a       pm
Time Zone                   z       MST
Time Zone offset            Z       -0700

Example:

package main

import(
  "fmt"
  "time"

  "github.com/mmcquillan/joda"
)

func main() {
  t := time.Now()
  f := joda.Format("Y-MM-dd H:mm:ssZ")
  fmt.Println(t.Format(f))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(joda string) (goda string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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