Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/metalmasterks/go-timezones

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/metalmasterks/go-timezones

  • v0.0.0-20200128121737-cc46c7536cff
  • Source
  • Go
  • Socket score

Version published
Created
Source

Package helps to get valid timezone names

Now working only on *nix and Mac Os

Examples

you can use repository if you want to read timezones once and store in memory for quick access

package main

import (
	"fmt"
	"time"
	"github.com/METALmasterKS/go-timezones"
)

func main() {
    tzRepository := go_timezones.NewRepository()
    tzlist := tzRepository.GetTimezones() 	
    
    location, err := time.LoadLocation(tzlist[0].String())
    if err != nil {
    	panic(err)
    }
    
    fmt.Print(time.Now().In(location))
}

if you don't need to store timezones in memory, you can use

package main

import (
	"fmt"
	"github.com/METALmasterKS/go-timezones"
)

func main() {
    tzlist := go_timezones.GetTimezones()	
    
    fmt.Print(tzlist)
}

FAQs

Package last updated on 28 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc