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).

1
  • 2
    What is a seven digit Julian format? I had never heard of it.
    – Oded
    Mar 10, 2013 at 10:03

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.