Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dominik 711 posts 733 karma points
    Aug 14, 2012 @ 14:46
    dominik
    0

    Textstring is interpreted as date

    Hello,

    I have created a property (type texstring).

    If i enter a string like "27/05/12" umbraco automatically adds 00:00:00 

    How can I remove this timestamp?

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 15, 2012 @ 00:00
    Bo Damgaard Mortensen
    0

    Hi dominik,

    If your property on the document is of type Textstring, you should be able to simply enter any kind og string without Umbraco manipulating it afterwards :-) Does this string come from a DateTime object, perhaps? If so, you should be able to use the .ToShortDateString(); method on the DateTime object.

    Let me know how it works out.

    All the best,

    Bo

  • dominik 711 posts 733 karma points
    Aug 16, 2012 @ 08:27
    dominik
    0

    THe property is of type textstring but if I enter 12-07-12 for example it is everytime rendered as date. I can not use ToShortDateString because sometimes it is a textstring.

    Dont know why umbraco renders it as a date.

    What i have done now to solve the issue is to use the GetProperty().Value method and this seems to work

Please Sign in or register to post replies

Write your reply to:

Draft