Documentation
¶
Index ¶
- Variables
- func CHECK_for_SUPPORTED_DATE_INPUT(inputDate string) (bool, map[string]interface{})
- func CONVERT_DATE(ALL_PARAMS ...interface{}) (string, string, time.Time)
- func DATE_IS_AFTER(first, prev time.Time) bool
- func DATE_IS_BEFORE(first, prev time.Time) bool
- func DISPLAY_TIME_DIFF(startTime time.Time, endTime time.Time) string
- func DateMath(dateObj time.Time, operation string, v_amount int, interval string) (string, time.Time)
- func FIX_FLOAT_PRECISION(num float64, precision int) float64
- func FIX_if_needed(input string) string
- func GET_DATE_DIFF(mtype string, currDATE time.Time, prevDATE time.Time) int
- func GET_DAYS_SINCE(past time.Time, curr_time time.Time) float64
- func GET_DAYS_UNTIL(future time.Time, curr_time time.Time) float64
- func GET_DB_DATE_UTC(input_DATE_OBJ time.Time) (time.Time, string, string, string)
- func GET_DIFF(ALL_PARAMS ...interface{}) float64
- func GET_DURATION(startTIME time.Time, endTIME time.Time, EXTRA_ARGS ...string) (float64, string, string)
- func GET_INCDEC_PERCENT(ALL_PARAMS ...interface{}) (float64, string, string, float64)
- func GET_RATIO(smallNUM float64, bigNUM float64, EXTRA_ARGS ...bool) float64
- func GET_TIME_DIFF(startTime time.Time, endTime time.Time) string
- func GET_Time_SINCE(past time.Time, curr_time time.Time, format string) float64
- func GET_Time_UNTIL(future time.Time, curr_time time.Time, format string) float64
- func IS_EVEN(input_NUM int) bool
- func IS_ODD(input_NUM int) bool
- func MakeRound(num float64) int
- func PERCENT_OF(ALL_PARAMS ...interface{}) float64
Constants ¶
This section is empty.
Variables ¶
var CST_Location_OBJ, _ = time.LoadLocation("America/Chicago") // aka CST }
var EST_Location_OBJ, _ = time.LoadLocation("America/New_York")
var LOCAL_Location_OBJ, _ = time.LoadLocation("Local")
Use ful Time zone locations
var MST_Location_OBJ, _ = time.LoadLocation("America/Denver") // MDT / Mountain Standard
var PST_Location_OBJ, _ = time.LoadLocation("America/Los_Angeles") // aka PST
var UTC_Location_OBJ, _ = time.LoadLocation("UTC")
Functions ¶
func CONVERT_DATE ¶
Converts the following
- a STRING date (in the proper format) to a time.Time DATE_OBJ
- a DATE_OBJ into a 'pretty date'
- an EPOCH .. into a pretty date.. and time.Time Date_OBJ (specify this with int(EPOCH_wasint64) .. this is because Go doesnt recognize int64 as a param explicitly
TZONE: Specify cst, est, mdt or pst if you need to override the timezone format returned
STRING format for the Date must be in one of the following or you will error:
MM-DD-YYYY
YYYY-MM-DD (ISO / British format)
MM/DD/YYYY
YYYY/MM/DD
Also accepts TIME.. Which must be apppended as: (24 hour format only supported)
XXXXX_18:05
XXXXX@18:05
Final param is for FORMAT specifiy: basic, simple, full, nano, british, justtime, justdate, timestamp (this uses SHOW_PRETTY_DATE ) You can also modify format by adding: _noday (ie, basic_noweek) - Prevents the weekday info from showing _nozone - prevents the timezone info from showing _reset_time - For situations where you want to omit the HH:MM cause you dont need it...resets time to 00:00
func DATE_IS_AFTER ¶
Easy way to find if FIRST date is AFTER the PREV DATE
func DATE_IS_BEFORE ¶
Correspondingly a date that is BEFORE
func DISPLAY_TIME_DIFF ¶
Takes in two date objects and returns the TIME DIFFERNCE between them in the 5m40s format
func DateMath ¶
func DateMath(dateObj time.Time, operation string, v_amount int, interval string) (string, time.Time)
Takes in a date object and adds or subtracts
based on the number and whatever operation you specify returns a date object
func FIX_FLOAT_PRECISION ¶
func FIX_if_needed ¶
func GET_DATE_DIFF ¶
Gets the difference between two dates (by days, hour or minutes)
func GET_DAYS_SINCE ¶
Pass PREVIOUS time.. then current or alt time)
func GET_DAYS_UNTIL ¶
pass future time, then current or alt time
func GET_DB_DATE_UTC ¶
Easy way to get the UTC form of DATE_OBJ so there is no confusion.. Returns Time, String(pretty date) and Weekday all converted from the orig time
func GET_DURATION ¶
func GET_DURATION(startTIME time.Time, endTIME time.Time, EXTRA_ARGS ...string) (float64, string, string)
Takes in Two Time periods.. and returns the duration in DAYS, Hours and Minutes (and comprable strings) Returns MINS, HOURS, DAYS (in float first, then strings)
func GET_INCDEC_PERCENT ¶
Returns Percentages INCREASE DECREASE for stocks etc... Takes in floats or INTs
As of MAY 2023.. This is the ULTIMATE GET PERCENTAGE function (replaces the previous GET_PRECENT) Also returns the DIFF between two numbers and if it was an INCREASE or DECERASE based on which number was passed FIRST RETURNS: res_PERC, changeTYPE, res_DESC, res_diff
func GET_TIME_DIFF ¶
Alias for DISPLAY_TIME_DIFF (which lives in GO_GO_Gadgets)
func GET_Time_SINCE ¶
Pass PREVIOUS time.. then current or alt time) .. also send format: days or mins (defaults to hours)
func GET_Time_UNTIL ¶
pass future time, then current or alt time .. also send format: days or mins (defaults to hours)
func PERCENT_OF ¶
func PERCENT_OF(ALL_PARAMS ...interface{}) float64
Ultimate percentage of two numbers
Types ¶
This section is empty.