SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
Part 4 – DATE FUNCTION USING
VB.NET
Dr.Girija Narasimhan 1
This slides are available http://slideshare.net /nbgirija
Watch this tutorial in youtube:
https://www.youtube.com/watch?v=pfj8bCmK8gs
Dr.Girija Narasimhan 2
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TextBox1.Text = DateAdd(DateInterval.Day, 1, Date.Now)
TextBox2.Text = DateAdd(DateInterval.Month, 1, Date.Now)
TextBox3.Text = DateAdd(DateInterval.Year, 1, Date.Now)
TextBox4.Text = DateAdd(DateInterval.Hour, 1, Date.Now)
TextBox5.Text = DateAdd(DateInterval.Second, 1, Date.Now)
TextBox6.Text = DateAdd(DateInterval.Minute, 1, Date.Now)
End Sub
End Class
Dr.Girija Narasimhan 3
Public Class Form2
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim d1 As Date = #2/4/2009#
Dim d2 As Date = #2/4/2010#
Dim res As Long
res = DateDiff(DateInterval.Day, d1, d2)
MsgBox("The number of time intrevals between the dates is::" & res)
Label5.Text = DateDiff(DateInterval.Year, d1, d2)
Label6.Text = DateDiff(DateInterval.WeekOfYear, d1, d2)
End Sub
Dr.Girija Narasimhan 4
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
Label1.Text = Now
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
Label2.Text = TimeString
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
Dim str As DateTime
Label3.Text = Now.AddYears(2)
str = Now
Label4.Text = str.AddYears(-1)
End Sub
End Class

Contenu connexe

En vedette

Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uPython Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Nikola Plejic
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Wolfgang Stock
 
Vb.net session 15
Vb.net session 15Vb.net session 15
Vb.net session 15
Niit Care
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
a_akhavan
 

En vedette (17)

Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Debugging in visual studio (basic level)
Debugging in visual studio (basic level)
 
Presentation1
Presentation1Presentation1
Presentation1
 
Making Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignMaking Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information Design
 
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uPython Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
 
What’s new in Visual C++
What’s new in Visual C++What’s new in Visual C++
What’s new in Visual C++
 
Logical Programming With ruby-prolog
Logical Programming With ruby-prologLogical Programming With ruby-prolog
Logical Programming With ruby-prolog
 
Part 1 picturebox using vb.net
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.net
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
 
Transforming the world with Information technology
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technology
 
Vb.net session 15
Vb.net session 15Vb.net session 15
Vb.net session 15
 
Part 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valuePart 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative value
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.net
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.net
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be Seen
 
Cpp lab 13_pres
Cpp lab 13_presCpp lab 13_pres
Cpp lab 13_pres
 
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
 

Plus de Girija Muscut

Plus de Girija Muscut (20)

Tamil Nalvar
Tamil Nalvar Tamil Nalvar
Tamil Nalvar
 
Visualization using Tableau
Visualization using TableauVisualization using Tableau
Visualization using Tableau
 
Introduction to ml
Introduction to mlIntroduction to ml
Introduction to ml
 
Effective Visualization with Tableau
Effective Visualization with TableauEffective Visualization with Tableau
Effective Visualization with Tableau
 
Guruvayoor song with audio-Udayasthamana puja
Guruvayoor song with audio-Udayasthamana puja Guruvayoor song with audio-Udayasthamana puja
Guruvayoor song with audio-Udayasthamana puja
 
Lakshmi lalli with audio
Lakshmi lalli with audioLakshmi lalli with audio
Lakshmi lalli with audio
 
Bagyada laskhmi purandara dasa
Bagyada laskhmi purandara dasaBagyada laskhmi purandara dasa
Bagyada laskhmi purandara dasa
 
Lakshmi lalli
Lakshmi lalliLakshmi lalli
Lakshmi lalli
 
Amba nee irangaayenil - papanasam sivan song
Amba nee irangaayenil - papanasam sivan songAmba nee irangaayenil - papanasam sivan song
Amba nee irangaayenil - papanasam sivan song
 
Mahalakshmi jagan madha - papanasm sivan tamil song
Mahalakshmi jagan madha  - papanasm sivan tamil songMahalakshmi jagan madha  - papanasm sivan tamil song
Mahalakshmi jagan madha - papanasm sivan tamil song
 
Sowbhagayaha laskhmi varuvai nee tamil song
Sowbhagayaha laskhmi varuvai nee tamil songSowbhagayaha laskhmi varuvai nee tamil song
Sowbhagayaha laskhmi varuvai nee tamil song
 
Bega baro Bega baro Neela Megha Varna-Vadhiraja Theertha
Bega baro Bega baro Neela Megha Varna-Vadhiraja TheerthaBega baro Bega baro Neela Megha Varna-Vadhiraja Theertha
Bega baro Bega baro Neela Megha Varna-Vadhiraja Theertha
 
Rama Nama Bhajan
Rama Nama BhajanRama Nama Bhajan
Rama Nama Bhajan
 
Saratha devi song 1
Saratha devi song 1Saratha devi song 1
Saratha devi song 1
 
Saraswathi bhajan 1 with tamil meaning
Saraswathi bhajan 1 with tamil meaningSaraswathi bhajan 1 with tamil meaning
Saraswathi bhajan 1 with tamil meaning
 
Aneyu karadare -Purandara Dasar.
Aneyu karadare -Purandara Dasar.Aneyu karadare -Purandara Dasar.
Aneyu karadare -Purandara Dasar.
 
Maithriam Bhajatha with tamil meaning (lyrics)
Maithriam Bhajatha with tamil meaning (lyrics)Maithriam Bhajatha with tamil meaning (lyrics)
Maithriam Bhajatha with tamil meaning (lyrics)
 
Unit 4 scd2-exercise 1-solution
Unit 4 scd2-exercise 1-solutionUnit 4 scd2-exercise 1-solution
Unit 4 scd2-exercise 1-solution
 
Unit 2 - Slowly Changing Dimension Type 1 (SCD1) (insert)
Unit 2  - Slowly Changing Dimension Type 1 (SCD1) (insert)Unit 2  - Slowly Changing Dimension Type 1 (SCD1) (insert)
Unit 2 - Slowly Changing Dimension Type 1 (SCD1) (insert)
 
Slowly Changing Dimension Type 1 (SCD 1) exercise 2 solution insert and update
Slowly Changing Dimension Type 1 (SCD 1) exercise 2 solution insert and updateSlowly Changing Dimension Type 1 (SCD 1) exercise 2 solution insert and update
Slowly Changing Dimension Type 1 (SCD 1) exercise 2 solution insert and update
 

Dernier

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 

Dernier (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

Part 4 date function using vb.net

  • 1. Part 4 – DATE FUNCTION USING VB.NET Dr.Girija Narasimhan 1 This slides are available http://slideshare.net /nbgirija Watch this tutorial in youtube: https://www.youtube.com/watch?v=pfj8bCmK8gs
  • 2. Dr.Girija Narasimhan 2 Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load TextBox1.Text = DateAdd(DateInterval.Day, 1, Date.Now) TextBox2.Text = DateAdd(DateInterval.Month, 1, Date.Now) TextBox3.Text = DateAdd(DateInterval.Year, 1, Date.Now) TextBox4.Text = DateAdd(DateInterval.Hour, 1, Date.Now) TextBox5.Text = DateAdd(DateInterval.Second, 1, Date.Now) TextBox6.Text = DateAdd(DateInterval.Minute, 1, Date.Now) End Sub End Class
  • 3. Dr.Girija Narasimhan 3 Public Class Form2 Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim d1 As Date = #2/4/2009# Dim d2 As Date = #2/4/2010# Dim res As Long res = DateDiff(DateInterval.Day, d1, d2) MsgBox("The number of time intrevals between the dates is::" & res) Label5.Text = DateDiff(DateInterval.Year, d1, d2) Label6.Text = DateDiff(DateInterval.WeekOfYear, d1, d2) End Sub
  • 4. Dr.Girija Narasimhan 4 Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click Label1.Text = Now End Sub Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click Label2.Text = TimeString End Sub Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click Dim str As DateTime Label3.Text = Now.AddYears(2) str = Now Label4.Text = str.AddYears(-1) End Sub End Class