@@ -932,3 +932,65 @@ func MustParseInLocation(loc *time.Location, s ...string) time.Time {
932932func Between (time1 , time2 string ) bool {
933933 return With (time .Now ()).Between (time1 , time2 )
934934}
935+
936+ // FormatRFC formats the time using the provided layout.
937+ //
938+ // Parameters:
939+ // - `layout`: A TimeFormatRFC value representing the layout to use for formatting.
940+ //
941+ // Returns:
942+ // - A string representing the formatted time.
943+ //
944+ // Example:
945+ //
946+ // formatted := FormatRFC(TimeFormat20060102T150405) // Returns the formatted time in the format "2023-08-15 13:45:30".
947+ func FormatRFC (layout TimeFormatRFC ) string {
948+ return With (time .Now ()).FormatRFC (layout )
949+ }
950+
951+ // FormatRFCshort formats the time using the provided layout.
952+ //
953+ // Parameters:
954+ // - `layout`: A TimeRFC value representing the layout to use for formatting.
955+ //
956+ // Returns:
957+ // - A string representing the formatted time.
958+ //
959+ // Example:
960+ //
961+ // formatted := FormatRFCshort(TimeRFC01T150405) // Returns the formatted time in the format "13:45:30".
962+ func FormatRFCshort (layout TimeRFC ) string {
963+ return With (time .Now ()).FormatRFCshort (layout )
964+ }
965+
966+ // FormatRFC formats the time using the provided layout.
967+ //
968+ // Parameters:
969+ // - `v`: A time.Time value representing the time to format.
970+ // - `layout`: A TimeFormatRFC value representing the layout to use for formatting.
971+ //
972+ // Returns:
973+ // - A string representing the formatted time.
974+ //
975+ // Example:
976+ //
977+ // formatted := FormatRFC(v, TimeFormat20060102T150405) // Returns the formatted time in the format "2023-08-15 13:45:30".
978+ func FFormatRFC (v time.Time , layout TimeFormatRFC ) string {
979+ return With (v ).FormatRFC (layout )
980+ }
981+
982+ // FormatRFCshort formats the time using the provided layout.
983+ //
984+ // Parameters:
985+ // - `v`: A time.Time value representing the time to format.
986+ // - `layout`: A TimeRFC value representing the layout to use for formatting.
987+ //
988+ // Returns:
989+ // - A string representing the formatted time.
990+ //
991+ // Example:
992+ //
993+ // formatted := FormatRFCshort(v, TimeRFC01T150405) // Returns the formatted time in the format "13:45:30".
994+ func FFormatRFCshort (v time.Time , layout TimeRFC ) string {
995+ return With (v ).FormatRFCshort (layout )
996+ }
0 commit comments