d7Date Nesnesi

d7Date nesnesi tarih işlemleri için kullanılır. Oluşturma:

Dim Tarih
Set Tarih = Doc.CreateSObject("d7Date")

SetToday

  • Dönüş Tipi: Void
  • Parametreler: Yok
  • Açıklama: Tarihi bugüne ayarlar

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Doc.MsgBox "Tarih: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

SetDate

  • Dönüş Tipi: Void
  • Parametreler:
  • - dateString (String): Tarih string'i
  • Açıklama: Tarihi ayarlar

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetDate "2024/01/15"
    Doc.MsgBox "Tarih: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

GetNorDate

  • Dönüş Tipi: Variant (String)
  • Parametreler: Yok
  • Açıklama: Normalize edilmiş tarihi döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim NorTarih
    NorTarih = Tarih.GetNorDate()
    Doc.MsgBox "Normalize Tarih: " & NorTarih
    Set Tarih = Nothing
End Sub

GetRevDate

  • Dönüş Tipi: Variant (String)
  • Parametreler: Yok
  • Açıklama: Reverse (gün/ay/yıl) formatında tarihi döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetDate "2024/01/15"
    Dim RevTarih
    RevTarih = Tarih.GetRevDate()
    Doc.MsgBox "Reverse Tarih: " & RevTarih
    Set Tarih = Nothing
End Sub

GetDOWStr

  • Dönüş Tipi: Variant (String)
  • Parametreler: Yok
  • Açıklama: Haftanın gününü string olarak döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim GunStr
    GunStr = Tarih.GetDOWStr()
    Doc.MsgBox "Haftanın Günü: " & GunStr
    Set Tarih = Nothing
End Sub

IsValid

  • Dönüş Tipi: Boolean
  • Parametreler: Yok
  • Açıklama: Tarihin geçerli olup olmadığını kontrol eder

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetDate "2024/01/15"
    
    If Tarih.IsValid() Then
        Doc.MsgBox "Geçerli tarih"
    Else
        Doc.MsgBox "Geçersiz tarih"
    End If
    Set Tarih = Nothing
End Sub

GetDateIndex

  • Dönüş Tipi: Integer
  • Parametreler: Yok
  • Açıklama: Tarih indeksini döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim Index
    Index = Tarih.GetDateIndex()
    Doc.MsgBox "Tarih İndeksi: " & Index
    Set Tarih = Nothing
End Sub

GetDOW

  • Dönüş Tipi: Integer
  • Parametreler: Yok
  • Açıklama: Haftanın gününü sayı olarak döndürür (1=Pazar, 2=Pazartesi, vb.)

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim Gun
    Gun = Tarih.GetDOW()
    Doc.MsgBox "Haftanın Günü (Sayı): " & Gun
    Set Tarih = Nothing
End Sub

GetWOY / GetWOY_ISO8601 / GetWOY_ISO

  • Dönüş Tipi: Integer
  • Parametreler: Yok
  • Açıklama: Yılın haftasını döndürür (ISO 8601 standardı)

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim Hafta
    Hafta = Tarih.GetWOY_ISO()
    Doc.MsgBox "Yılın Haftası (ISO): " & Hafta
    Set Tarih = Nothing
End Sub

Increment

  • Dönüş Tipi: Void
  • Parametreler:
  • - days (Integer): Eklenecek gün sayısı
  • Açıklama: Tarihe gün ekler

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Tarih.Increment 30  ' 30 gün ekle
    Doc.MsgBox "30 Gün Sonra: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

WeekToDate / WeekToDate_ISO8601 / WeekToDate_ISO

  • Dönüş Tipi: Integer
  • Parametreler:
  • - year (Integer): Yıl
  • - week (Integer): Hafta
  • - dayOfWeek (Integer): Haftanın günü
  • Açıklama: Hafta bilgisinden tarih oluşturur

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Dim GunSayisi
    GunSayisi = Tarih.WeekToDate_ISO(2024, 3, 1)  ' 2024 yılı, 3. hafta, Pazartesi
    Doc.MsgBox "Tarih: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

GetDay

  • Dönüş Tipi: Integer
  • Parametreler: Yok
  • Açıklama: Günü döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim Gun
    Gun = Tarih.GetDay()
    Doc.MsgBox "Gün: " & Gun
    Set Tarih = Nothing
End Sub

GetMonth

  • Dönüş Tipi: Integer
  • Parametreler: Yok
  • Açıklama: Ayı döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim Ay
    Ay = Tarih.GetMonth()
    Doc.MsgBox "Ay: " & Ay
    Set Tarih = Nothing
End Sub

GetYear

  • Dönüş Tipi: Integer
  • Parametreler: Yok
  • Açıklama: Yılı döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim Yil
    Yil = Tarih.GetYear()
    Doc.MsgBox "Yıl: " & Yil
    Set Tarih = Nothing
End Sub

GetMonthStr

  • Dönüş Tipi: Variant (String)
  • Parametreler: Yok
  • Açıklama: Ayı string olarak döndürür

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Dim AyStr
    AyStr = Tarih.GetMonthStr()
    Doc.MsgBox "Ay (String): " & AyStr
    Set Tarih = Nothing
End Sub

AyinIlkGununeGit

  • Dönüş Tipi: Void
  • Parametreler: Yok
  • Açıklama: Ayın ilk gününe gider

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Tarih.AyinIlkGununeGit
    Doc.MsgBox "Ayın İlk Günü: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

AyinSonGununeGit

  • Dönüş Tipi: Void
  • Parametreler: Yok
  • Açıklama: Ayın son gününe gider

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Tarih.AyinSonGununeGit
    Doc.MsgBox "Ayın Son Günü: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

HaftaninIlkGununeGit

  • Dönüş Tipi: Void
  • Parametreler: Yok
  • Açıklama: Haftanın ilk gününe gider

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Tarih.HaftaninIlkGununeGit
    Doc.MsgBox "Haftanın İlk Günü: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

HaftaninSonGununeGit

  • Dönüş Tipi: Void
  • Parametreler: Yok
  • Açıklama: Haftanın son gününe gider

Örnek Kullanım:

Sub Makro1()
    Dim Tarih
    Set Tarih = Doc.CreateSObject("d7Date")
    Tarih.SetToday
    Tarih.HaftaninSonGununeGit
    Doc.MsgBox "Haftanın Son Günü: " & Tarih.GetNorDate()
    Set Tarih = Nothing
End Sub

---