yuvarajupadhyaya

Nullable date format

Jun 13th, 2022
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public Nullable<DateTime> StartDateYear { get; set; }
  2. public string StartDateYearText {
  3. get
  4. {
  5. if(StartDateYear!=null)
  6. {
  7. return StartDateYear?.ToString("dd/MM/yyyy");
  8.  
  9. }
  10. else
  11. {
  12. return string.Empty;
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment