Golang os.Chtimes() function example
package os
Golang os.Chtimes() function usage example
accesstime := time.Now().Local() // access time
currenttime := time.Now().Local() // modification time
err = os.Chtimes(filename, accesstime, currenttime)
if err != nil {
fmt.Println(err)
}
see example at : https://www.socketloop.com/tutorials/golang-change-a-file-last-modified-date-and-time
Reference :
Advertisement
Something interesting
Tutorials
+10.4k Golang : cannot assign type int to value (type uint8) in range error
+4.9k JQuery : Calling a function inside Jquery(document) block
+13.9k Golang : convert(cast) string to float value
+9.7k Golang : Load ASN1 encoded DSA public key PEM file example
+6.7k Golang : Check if password length meet the requirement
+10.6k Golang : Resolve domain name to IP4 and IP6 addresses.
+7.1k Golang : Get Alexa ranking data example
+14.8k Golang : Find commonalities in two slices or arrays example
+29.7k Golang : Record voice(audio) from microphone to .WAV file
+6.6k Golang : How to determine if request or crawl is from Google robots
+18.5k Golang : Aligning strings to right, left and center with fill example
+9.9k Golang : ffmpeg with os/exec.Command() returns non-zero status