473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to minus a date?

hello... can someone tell me how to minus a date value?
e.g. 17/01/2005 - 1 would be 18/01/2005

can someone show me how this is done?
Nov 19 '05 #1
2 3653
Maybe you're looking for the Date.Subtract method?

In VB.NET you could also use the DateDiff function.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Asha" <As**@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
hello... can someone tell me how to minus a date value?
e.g. 17/01/2005 - 1 would be 18/01/2005

can someone show me how this is done?

Nov 19 '05 #2
Those will do.

An alternate way would be to use the AddDays method
....and feed it a negative number ( -1 in this case ).

VB.NET
Public Function AddDays(ByVal value As Double) As DateTime

C#
public DateTime AddDays(double value);


Juan T. Llibre
ASP.NET MVP
===========
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ud****************@TK2MSFTNGP12.phx.gbl...
Maybe you're looking for the Date.Subtract method?

In VB.NET you could also use the DateDiff function.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Asha" <As**@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
hello... can someone tell me how to minus a date value?
e.g. 17/01/2005 - 1 would be 18/01/2005

can someone show me how this is done?


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Newbie | last post by:
Hi, Could someone please tell how MINUS operator works for comparing and giving non-matching records in Table1? Does MINUS operator compares all records of Table1 with all records of Table2 to...
6
by: RobG | last post by:
I am writing a script to move an absolutely positioned element on a page by a factor using style.top & style.left. The amount to move by is always some fraction, so I was tossing up between...
1
by: Arjen | last post by:
Hi, How can I calculate the date 2 years ago? I get a problem with datetime minus int (year). Can someone help? Thanks!
5
by: Jumbo | last post by:
I need a script for my site that shows my servertime minus 7 hours. Anyone who can help?
6
by: vijayk | last post by:
Hi all, I have a field which has data as YYYYMMDD, and I have to find the age of the person by substracting it from current date. can you please please advice... thanks
6
by: Matthew Cook | last post by:
I would like to overload the unary minus operator so that I can negate an instance of a class and pass that instance to a function without creating an explicit temporary variable. Here is an...
4
by: tamnguyet | last post by:
I have n days and a date, I want a date plus(or minus) to n days.How can I do that in javascript
7
Dököll
by: Dököll | last post by:
Greetings and salutations! Ran a quick search here a found this: http://www.thescripts.com/forum/thread700194-Minus+date.html Though it is very helpful when dealing with dates alone, I cannot...
1
nathj
by: nathj | last post by:
Hi, I'm currently developing a web system that allows people to register for the various events my organisation hosts. I have completed the online registration system and now need to mnake a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.