0

Am working on a small application that generate Google query’s. With the operator "daterange:" you can limit your result. Exampel (“searchstring” daterange:juliandate)

The daterange operator in Google needs a seven digit Julian format. I have found some example like this

    datediff("yyyy","01/01/1900",date) & format(date,"y")

Need help to found some code solution to convert normal date-format to seven digit Julian format (VB-code).

user1318186
  • 1
  • 2
  • 4

1 Answers1

0

Start with import at start of your file

Imports System.Globalization

To convert your date use code below.

Dim dt As DateTime
Dim jc As String
dt = DateTime.ParseExact("2012/12/15", "yyyy/MM/dd", CultureInfo.InvariantCulture)
jc = dt.Year.ToString + dt.DayOfYear.ToString
Mahmut Ali ÖZKURAN
  • 1,120
  • 2
  • 23
  • 28