Click here to Skip to main content
13,898,354 members
Click here to Skip to main content
Add your own
alternative version


15 bookmarked
Posted 6 Aug 2007
Licenced CPOL

Seagate Date Code Calculator

, 6 Aug 2007
Rate this:
Please Sign up or sign in to vote.
How to get the date 20 November 2005 from the number 06212

Screenshot - SeagateDateCode.jpg


The code described in this article helps users convert Seagate's (the hard drive manufacture) date code to a DateTime value.

This article is based on this documentation.


I had to check some hard drives for warranty, and found myself checking very old hard drives.

The code

Here is the actual code involved:

Class Variables

private DateTime datecalc;
private string _datecode;

Class Properties

public string DateCode
    get { return _datecode; }
        int _CodeYear = 0;
        byte _CodeWeek = 0;
        byte _CodeDayOfWeek = 0;
        _datecode = value;
        if (_datecode.Length == 5)
            //Get the number of weeks to add
            _CodeWeek = Convert.ToByte(_datecode.Substring(2, 2));
            //Get the day of the week in the final week
            _CodeDayOfWeek = Convert.ToByte(_datecode.Substring(4));
        else if (_datecode.Length == 4)
            //Get the number of weeks to add
            _CodeWeek = Convert.ToByte(_datecode.Substring(2, 1));
            //Get the day of the week in the final week
            _CodeDayOfWeek = Convert.ToByte(_datecode.Substring(3));
        if (_datecode.Length == 4 || _datecode.Length == 5)
            _CodeYear = (2000 + Convert.ToInt32(_datecode.Substring(0, 2)) - 1);
            datecalc = new DateTime(_CodeYear, 7, 1);
            do { datecalc = datecalc.AddDays(1); } 
            while (datecalc.DayOfWeek != DayOfWeek.Saturday);
            datecalc = datecalc.AddDays((_CodeWeek * 7) + _CodeDayOfWeek);

public DateTime CalculatedDate
    get { return datecalc; }

Class Constructors

public SeagateDateCodeCalc()

public SeagateDateCodeCalc(string dateCode)
    this.DateCode = dateCode;


This is my first submission here, so let me know if I am missing anything.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...


Comments and Discussions

QuestionThank You! Pin
Jason Bradley Smith13-Nov-14 14:24
professionalJason Bradley Smith13-Nov-14 14:24 
AnswerRe: Thank You! Pin
Paw Jershauge19-Nov-14 5:08
memberPaw Jershauge19-Nov-14 5:08 
GeneralRunning the prog Pin
gimmegimme8-Oct-08 11:00
membergimmegimme8-Oct-08 11:00 
GeneralRe: Running the prog Pin
Paw Jershauge9-Oct-08 2:42
memberPaw Jershauge9-Oct-08 2:42 
GeneralRe: Running the prog Pin
icefloe018-Jan-09 4:37
membericefloe018-Jan-09 4:37 
I believe their point is this; If someone happens upon this from a search engine, creates a login to get the file, and extracts it (like me), it is not immediately obvious that you have to drill down through several folders to find the executeable. Does the executeable have to be all the down in the bin folder to work or can it be moved to the top folder? It would be much easier for the inexperienced (that includes me) to be able to use this calculator if the executeable was in the first folder that's opened. I'm glad you made it though as saves me a bunch of headscratching to create an Excel script to do it. So I give the project an excellent rating as far as it's usefulness to me, but a 2 for useability. When I first extracted it, I looked in the first folder, did not see an exe, looked in the second folder, did not see an exe and almost gave up. I was about to ask online if anyone had a compiler to make an exe out of it, and then decided to keep digging through the folders. Now I'm glad I did.
GeneralRe: Running the prog Pin
Paw Jershauge8-Jan-09 10:14
memberPaw Jershauge8-Jan-09 10:14 
GeneralRe: Running the prog Pin
icefloe018-Jan-09 11:40
membericefloe018-Jan-09 11:40 
GeneralRe: Running the prog Pin
Knight of Cydonia11-Jan-09 12:37
memberKnight of Cydonia11-Jan-09 12:37 
GeneralRe: Running the prog Pin
Paw Jershauge11-Jan-09 23:47
memberPaw Jershauge11-Jan-09 23:47 
GeneralRe: Running the prog Pin
Knight of Cydonia12-Jan-09 8:29
memberKnight of Cydonia12-Jan-09 8:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190306.1 | Last Updated 6 Aug 2007
Article Copyright 2007 by Paw Jershauge
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid