This is a migrated thread and some comments may be shown as answers.

=now() and datetime

1 Answer 459 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kmv
Top achievements
Rank 1
kmv asked on 02 Sep 2008, 09:55 PM

what datetime functions does =now() support, i was trying to set a parameter default value to =now().AddDays(-1).Date but now() does not seem to return a true datetime. Is there a way to do this



thanks
kevin

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Sep 2008, 10:54 AM
Hi Kevin,

There are two possible approaches to handle such scenario:
  1. Make an explicit convertion to double - =Now().AddDays(CDbl(-1)).Date
  2. Create a user function that returns the desired DateTime:

     public static DateTime MyTime()
            {
                return DateTime.Now.AddDays(-1).Date;
            }
    and then invoke it directly with =MyTime().
Hope these help.
All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
kmv
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or