PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Subtract 1 day from a date-VBForums
Results 1 to 5 of 5

Thread: [RESOLVED] Subtract 1 day from a date

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Toronto, ON
    Posts
    117

    Resolved [RESOLVED] Subtract 1 day from a date

    How do i subtract 1 day from a date?

  2. #2
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: Subtract 1 day from a date

    vb Code:
    1. Dim d As Date = Date.Today
    2. d = d.AddDays(-1)
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0 PHP Image Gallery v2.0
    VB 2005
    Find Computers on a network Simple License Encryption SQL Server Database Access dll Use Reflection to Return Crystal ReportDocument Silently Print PDF Generic Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost) MSDN Design Guidelines API Reference Inno Setup Compiler Inno Setup Preprocessor ISTool - Fairly easy to use GUI for creating inno setup projects Connection Strings NAnt -Automated Builds Cruise Control .NET - Frontend for automated builds

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Toronto, ON
    Posts
    117

    Re: Subtract 1 day from a date

    Quote Originally Posted by bmahler
    vb Code:
    1. Dim d As Date = Date.Today
    2. d = d.AddDays(-1)
    hahash....so simple....sweet deal, thanks man

  4. #4
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: Subtract 1 day from a date

    sure, be sure to mark this resolved if your question has been answered.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0 PHP Image Gallery v2.0
    VB 2005
    Find Computers on a network Simple License Encryption SQL Server Database Access dll Use Reflection to Return Crystal ReportDocument Silently Print PDF Generic Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost) MSDN Design Guidelines API Reference Inno Setup Compiler Inno Setup Preprocessor ISTool - Fairly easy to use GUI for creating inno setup projects Connection Strings NAnt -Automated Builds Cruise Control .NET - Frontend for automated builds

  5. #5
    Junior Member
    Join Date
    Oct 2012
    Posts
    18

    Calculate 1 day

    i select 1 day, run my report it display 2days..but if i select 10 days is display 10 days..i think single digit like increment by 1..how to solve to display exactly as 1....eg 1 year 1 day= 1 year 1 day...1months 1 day= 1 months 2day.my days is playing up here...how can i have exactly as 1 day..

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width