time format in 24 hours

Posted by: lhanicotte on 8 September 2017, 2:28 pm EST

  • Posted 8 September 2017, 2:28 pm EST

    I have in my spread some datetime cell. One of the cells is initialise to the value "15:00" but the cell show only "03:00". How can i do to show "15:00" in my cell?
  • Replied 8 September 2017, 2:28 pm EST

    The Celltype is probably using your system settings I tested this and it works to display 24 hour time.


    FarPoint.Win.Spread.CellType.DateTimeCellType dtct = new FarPoint.Win.Spread.CellType.DateTimeCellType();


    dtct.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined;


    dtct.UserDefinedFormat = "MM/DD/YY HH:mm:ss";


    fpSpread1.ActiveSheet.Cells[0, 0].CellType = dtct;


    fpSpread1.ActiveSheet.Cells[0, 0].Value = System.DateTime.Now;

  • Replied 8 September 2017, 2:28 pm EST

    Thanks, it's working
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels