How to Separate The Time Format

Posted by: spreadteam on 8 September 2017, 1:01 pm EST

  • Posted 8 September 2017, 1:01 pm EST


    How to separate the DateTimeCelltype  Format in spread ....

     for example it is displaying the Hour : Minute : Second   (09:25:25 PM)

    i dont need the second

     in the column how to eliminate the second by using the Datetimecelltype  in spread

    or any other method to elimiate this type are welcome ...

    I am Using c# for Development

    and using Windows spread 3 for VS2005


  • Replied 8 September 2017, 1:01 pm EST

    Try the following...

    FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType();
    dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined;
    dt.UserDefinedFormat = "MM/dd/yyyy hh:mm tt";
    fpSpread1.ActiveSheet.Cells[0,0].CellType = dt;
    fpSpread1.ActiveSheet.Cells[0,0].Value = DateTime.Now;
Need extra support?

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

Learn More

Forum Channels