tools

package
v0.0.0-...-01c142f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Capital   string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Lowercase string = "abcdefghijklmnopqrstuvwxyz"
	Number    string = "0123456789"
	SpeStr    string = "~!@#$%^&*()/-_+-=|{}[]<>?"
)
View Source
var (
	YearFmt   = "2006"
	MonFmt    = "2006-01"
	DayFmt    = "2006-01-02"
	HourFmt   = "2006-01-02 15"
	MinuteFmt = "2006-01-02 15:04"
	SecondFmt = "2006-01-02 15:04:56"
	MonthStr  = [13]string{"00", "01", "02", "03", "04", "05", "06",
		"07", "08", "09", "10", "11", "12"}
	MonthDay = [13]int{29, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
)
View Source
var (
	Specity = []string{
		"北京市", "上海市", "天津市", "重庆市"}
)

Functions

func AllStr

func AllStr(req int) string

func CapitalOnly

func CapitalOnly(req int) string

func CheckProvincesData

func CheckProvincesData(orm *xorm.Engine)

func FmtTime

func FmtTime(stamp int64, format string) string

func GetAllProvincesID

func GetAllProvincesID(orm *xorm.Engine) (res []string)

func GetDayUnix

func GetDayUnix(date int64) int64

func GetMonthUnix

func GetMonthUnix(date int64) int64

func GetMonthWorkDay

func GetMonthWorkDay(date int64) int

func GetNowUnix

func GetNowUnix(format string) int64

func GetYearAndMonth

func GetYearAndMonth(date int64) (year, month int)

func GetYearUnix

func GetYearUnix(date int64) int64

func IDnumGeneration

func IDnumGeneration(orm *xorm.Engine)

func InsertProvinces

func InsertProvinces(xrom *xorm.Engine, name string, code string, pId int64) int64

func IsLeapYear

func IsLeapYear(year int) bool

func LowercaseOnly

func LowercaseOnly(req int) string

func NoSpeStr

func NoSpeStr(req int) string

func NumberOnly

func NumberOnly(req int) string

func Random

func Random(baseStr []string, req int) (res string)

func SpeStrOnly

func SpeStrOnly(req int) string

func StringRand

func StringRand(str string, req int) string

func TimeToUnix

func TimeToUnix(s string, format string) int64

Types

type ProvincesCode

type ProvincesCode struct {
	Id       int64
	Name     string
	Code     string
	ParentId int64
}

func NewProvincesCode

func NewProvincesCode(name string, code string, pId int64) (obj *ProvincesCode)

Jump to

Keyboard shortcuts

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