[28] Results

PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)

php date timestamp strtotime

Problem :

Need to convert a date string in PHP before storing the date into database(MariaDB/MySQL). The field in table….... read more

Golang : Byte format example

golang round byte-format giga mega terra


You want to format the long integer or number string representing a byte size such as giga, mega, peta….... read more

Golang : Fix image: unknown format error

golang image-dimension width height unknown-format-error decode-config

Problem :

You want to find out the dimension of an image file with image.DecodeConfig() function - to….... read more

Elastic Search : Mapping date format and sort by date

elasticsearch sort date mapping

While working on the job board for Socketloop.com recently, I need to sort the Elastic Search result based….... read more

Golang : Parse date string and convert to dd-mm-yyyy format

golang dd-mm-yyyy date-time convert-string-date

A reader enquired on how to use Golang to convert date string such as "28th nov 2016" or "nov….... read more

Golang : minus time with Time.Add() or Time.AddDate() functions to calculate past date

golang time-different future-date past-date

Let's go back into history for this tutorial's sake. Somehow you have invented a time traveling device powered by Golang….... read more

Golang : Format numbers to nearest thousands such as kilos millions billions and trillions

golang format-numbers nearest-thousands truncate-huge-numbers


You want to format a given number to the nearest thousands such as kilos, millions, billions, and trillions. For….... read more

Golang : How to determine if a year is leap year?

golang date leap-year

A leap year is a year with 366 days instead of 365 days. The algorithm to calculate if a year….... read more