SORU
12 ŞUBAT 2010, Cuma


Nasıl powershell'de bir DateTime biçimi için?

Get-Date böyle sorun komut biçimi:

$date = Get-Date -format "yyyyMMdd"

ama bir değişken a date, ne var bir kere format mı? Aşağıdaki tablo

$dateStr = $date -format "yyyMMdd"

bu hatayı döndürür:

"Bir değer girmelisiniz ifade sağ tarafı '-f'nin üzerinde ". operatör

CEVAP
12 ŞUBAT 2010, Cuma


Senin ki gibi aynı .NET.

$DateStr = $Date.ToString("yyyyMMdd")

ya

$DateStr = '{0:yyyyMMdd}' -f $Date

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • CasinoRoyaleMovie's channel

    CasinoRoyale

    1 AĞUSTOS 2006
  • Rayone GB

    Rayone GB

    14 Temmuz 2007
  • USI Events

    USI Events

    6 AĞUSTOS 2013

İLGİLİ SORU / CEVAPLAR