Title: Format combine?
Last modified: April 28, 2021

---

# Format combine?

 *  [finnfin](https://wordpress.org/support/users/finnfin/)
 * (@finnfin)
 * [5 years ago](https://wordpress.org/support/topic/format-combine/)
 * I’ve seen the method `format split` mentioned here, but was wondering is there
   a combine method? I have separate date and time fields that I would like to combine
   into one for calc and conditional purposes. I realize that the simple solution
   is to just turn the fields into date/time field, but thought I’d see if this 
   is something easily doable first.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [iantresman](https://wordpress.org/support/users/iantresman/)
 * (@iantresman)
 * [5 years ago](https://wordpress.org/support/topic/format-combine/#post-14376221)
 * I’m pretty sure that something like the following should work:
 * `[set combinedfield][field myfield] -- [field myfield2][/set]`
 *  Thread Starter [finnfin](https://wordpress.org/support/users/finnfin/)
 * (@finnfin)
 * [5 years ago](https://wordpress.org/support/topic/format-combine/#post-14376449)
 * Actually just realized the [set] and [get] will do it as well. Thank you!
 *  Thread Starter [finnfin](https://wordpress.org/support/users/finnfin/)
 * (@finnfin)
 * [5 years ago](https://wordpress.org/support/topic/format-combine/#post-14376978)
 * Follow up question related to time and date and formatting them. I’m trying to
   do some basic calculations using time. Like `end time - start time` to get duration,
   but having trouble getting any sort of output when doing calc with time, let 
   alone with time and date.
 * Is there any sort of proper method of doing that other than splitting everything
   into smaller chunks like day, month, yeah, hour and minute with `set`? Gets even
   trickier if start and end are on different dates.
 * Edit: Is there any way to format date and time into a timestamp?
    -  This reply was modified 5 years ago by [finnfin](https://wordpress.org/support/users/finnfin/).
 *  [polarracing](https://wordpress.org/support/users/polarracing/)
 * (@polarracing)
 * [5 years ago](https://wordpress.org/support/topic/format-combine/#post-14378376)
 * Format your date field yourself to timestamp. Look at the UNIX format rules.
 * `Ymd` would give you 20210429 from current date. If you need time as well ad 
   the unix vales for time as well.
 *  Thread Starter [finnfin](https://wordpress.org/support/users/finnfin/)
 * (@finnfin)
 * [5 years ago](https://wordpress.org/support/topic/format-combine/#post-14381380)
 * Thanks, yeah works fine that way. Is there any way to replace characters in the
   return value, or prevent certain characters from being displayed?
 * I’m creating calendar links and certain characters are problematic for the URLs.
   Like ‘%’ doesn’t play well with Google Calendar links and should be encoded as`%
   25`. Any way to achieve that with just this plugin?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Format combine?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [finnfin](https://wordpress.org/support/users/finnfin/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/format-combine/#post-14381380)
 * Status: not resolved