Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

FormatDateTime Function

Posted on August 21, 2013October 26, 2015 By David Kittell

This is a default function within VBScript that should work in any VBScript situation.

FormatDateTime(date,format)

Date is required and has to be in a valid format but easily can accept date() or now()

Date() would only display the current date where now() would be date and time.

Format would be something like below
0 = vbGeneralDate – Default. Returns date: mm/dd/yy and time if specified: hh:mm:ss PM/AM.
1 = vbLongDate – Returns date: weekday, monthname, year
2 = vbShortDate – Returns date: mm/dd/yy
3 = vbLongTime – Returns time: hh:mm:ss PM/AM
4 = vbShortTime – Return time: hh:mm

Originally Posted on August 21, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

ASP Code VB

Post navigation

Previous post
Next post

Related Posts

PHP Create MySQL Table From CSV File Headings

Posted on November 5, 2015

$handle = fopen("test.csv", "r"); // Read first (headers) record only) $data = fgetcsv($handle, 1000, ","); $sql= ‘CREATE TABLE table_name (‘; for($i=0;$i<count($data); $i++) { $sql .= $data[$i].’ VARCHAR(50), ‘; } //The line below gets rid of the comma $sql = substr($sql,0,strlen($sql)-2); $sql .= ‘)’; echo $sql; fclose($handle); Reference: https://bytes.com/topic/mysql/answers/746696-create-mysql-table-field-headings-line-csv-file All information…

Read More

OpenSSL – Extract PFX Certificate & Update SSL Certificate

Posted on May 18, 2016March 9, 2017

First this process doesn’t hack/crack the PFX you will need the password still. Scenario you have to update your SSL certificate but all you saved was your PFX file and know the password for it. openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes You get prompted for the Import Password…

Read More

Pageview – Quick Report

Posted on October 14, 2013October 26, 2015

SELECT ( SELECT [projectname] FROM [tblRIMicroSite_Forms] WHERE CHARINDEX([tblRIMicroSite_Forms].[url], pv.[url]) > 0 ) AS Project ,dbo.fnFormatDate([datetime], ‘MM-DD-YYYY HH:NN AMPM’, NULL) AS [DateTime] ,[ipaddress] AS ‘IP Address’ ,[ipint] AS ‘IP Int’ ,[IPLocation] AS ‘IP Location’ ,[mobile] AS ‘Mobile’ ,( CASE WHEN ( SELECT url FROM [tblRIMicroSite_Forms] WHERE CHARINDEX([tblRIMicroSite_Forms].[url], pv.[url]) > 0 )…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
©2025 David Kittell | WordPress Theme by SuperbThemes