Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7893203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:04:20+00:00 2026-06-03T07:04:20+00:00

The jquery FullCalendar plugin has a neat format for time. If it the time

  • 0

The jquery FullCalendar plugin has a neat format for time.

If it the time is 7:00pm, the format shows up as 7p.

If it the time is 7:30am, the format shows up as 7:30a.

Question: Is there any way to use standard formatting to accomplish this with c# sharp? Obviously I can create logic to do this myself, but I’m hoping there is a format string that will accopmlish this.

ie (doesn’t work):

MyDateTime.ToString("h{:mm}t");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:04:21+00:00Added an answer on June 3, 2026 at 7:04 am

    Formatting strings do not have conditionals – there is no way to specify a condition within a format string.

    You will need to use a standard if and format accordingly.

    if(MyDateTime.Minutes == 0)
    {
      return MyDateTime.ToString("h");
    }
    
    return MyDateTime.ToString"h:mmt");
    

    Or, in one line:

    return MyDateTime.ToString((MyDateTime.Minutes == 0)?"h":"h:mmt");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question about jquery plugin fullcalendar. How I can return to selected date after
I'm using the fullCalendar jQuery plugin and it has options for adding events to
I'm using the 'FullCalendar' jQuery plugin however the format of my date string data
I'm currently using the jQuery fullcalendar plugin but I've came across an issue regarding
I am using the jQuery Fullcalendar plugin (http://arshaw.com/fullcalendar). I am only using it for
The jQuery fullCalendar plugin seems to have a problem in the editable mode in
I am using Jquery UI Dialog box with FullCalendar plugin. My problem is UI
I'm working on a small app that makes use of the jQuery plugin Fullcalendar.
I have a standard Jquery date picker which shows 2 textboxes. One textbox has
I've just discovered the fullCalendar jQuery plugin which does pretty much everything I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.