Jontas

My digital notepad (notes etc)

Jontas

Main menu

Skip to primary content
Skip to secondary content
  • Home

Tag Archives: datetime

MS SQL Truncating seconds (and milliseconds) from a datetime

Posted on 2012 December 19 by jontas

By converting a DateTime to a char(16) the seconds and milliseconds are truncated from the DateTime.

DECLARE @d datetime
SELECT @d = GETDATE()
SELECT @d, CONVERT(CHAR(16), @d, 121)
 
--2012-12-04 11:50:42.160	2012-12-04 11:50

declare @d datetime select @d = GETDATE() select @d, convert(char(16), @d, 121) --2012-12-04 11:50:42.160 2012-12-04 11:50

Posted in SQLServer | Tagged datetime, mssql

Tags

3D printer Android apache apache2 apt-get asp.net C# charset cross browser testing debian email encoding Fermat Fermat assembly git html Internet Explorer j2me Java liftweb linux Magento magento admin mail mailserver MakerBot mobile mssql MVC3 MySQL OpenVPN org.w3c.dom php php5 PostgreSQL product SubVersion sudo ubuntu utf-8 uuid vb.net VirtualBox vpn xml

Categories

  • Android
  • Apache2
  • Arduino
  • ASP.NET
  • ASP.NET C#
  • Avant Browser
  • boinc
  • BSD
  • Build server
  • C#
  • Cisco
  • CSS
  • Currently Making / Made / Buildlog
  • Cygwin
  • DataBase
  • debian
  • Development
  • DOMElement
  • DOSBox
  • dotNet
  • Eclipse
  • exim4
  • Fermat
  • Firefox
  • Flock
  • gallery2
  • GetBoo
  • GIT – Fast Version Control System
  • Google Chrome
  • HTML
  • IDE
  • IIS
  • Internet Explorer
  • Java
  • JavaScript
  • JQuery
  • Laptops
  • LDraw
  • Lift
  • linux
  • Lynx
  • Magento
  • Makerbot
  • Making
  • md
  • MediaWiki
  • Mindset
  • MLCad
  • Mobile Phone
  • Modern Warfare 2
  • MVC3
  • MySQL
  • Netscape
  • OpenSSH
  • OpenVPN
  • OpenX
  • Opera
  • PHP
  • PHP4
  • PHP5
  • PHPMailer
  • PHPUnit
  • piwik
  • PostgreSQL
  • Programming
  • Python
  • RAID
  • remote desktop
  • ReplicatorG
  • rsync
  • Scala
  • SeaMonkey
  • sendmail
  • shorewall
  • SimpleXML
  • SQLServer
  • SubVersion
  • sudo
  • Survival
  • synergy
  • Systems (programs etc)
  • ubuntu
  • unix
  • vb.Net
  • VirtualBox
  • Visions / Hopes for the future
  • Visual Studio 2012
  • Web development
  • windows
  • Windows 2000
  • Windows 2003
  • Windows 7
  • Windows Vista
  • Windows XP
  • WordPress

AIS

  • AIS live Utlängen
  • Trelle.net AIS Skåne & Blekinge

Blogroll

  • Communications wiki
  • Computer (and computer related) Hardware wiki
  • Misc usefull items
  • Self Sufficient Folks – wiki

comics

  • Piled Higher and Deeper
  • User Friendly
Proudly powered by WordPress