The Saint Andrew cross is one of the oldest national flags of all, dating back at least to the 12th century, although the honour of the oldest flag among the modern nations generally falls to the flag of Denmark.
Stuart Notholt

(Notes taken from Graham Bartram's presentation on this topic at the ICV 19 in York.)

The Saint Andrew's cross.
Who was Saint Andrew? Andrew was one of Christ's disciples and legend has it he was active in Scythia, and crucified on a cross with diagonal beams. His remains were preserved, and (again by legend) Constantine wanted to remove them to Constantinople. A Greek monk was warned by an angel of this intent, and instructed to take them to the ends of the Earth. This he did, until he was shipwrecked in Scotland. Some of Andrew's relics were known to have been brought to St. Andrews, Scotland, by the Bishop of Hexham in 733 AD (Hexham Abbey is also dedicated to St. Andrew). In 1160 AD, St. Andrews Cathedral was erected, and the saint's relics were kept there until the cathedral was destroyed during the Reformation.

The earliest record to the Saint Andrew's cross flag dates from 1165 AD, where reference is made to a 9th Century battle. This was known in the 16th Century, although no record of the original source remains today.

Based on the chronology above, It would be better to say that the flag dated from the 16th Century.
Kenneth Campbell Fraser, 23 November 1998

Here's some additional information on the early St Andrew's cross from
Perrin:

1385: The ordinances for its use on soldier's uniforms read:
'Item every man French and Scots shall have a sign before and behind, namely
a white St Andrew's Cross, and if his jack is white or his coat white he
shall bear the said white cross in a piece of black cloth round or square'.
Two quotes from the Accounts of the Lord High Treasurer of Scotland:1512: Payment for a roll of blue say (woollen bunting) for the
banner of a ship 'with Sanct Androis cors in the myddis'.1540: Delivered to be three ensigns for the ships sixteen 'elnis'
red and yellow 'taffites'. Delivered to be the crosses thereof, four 'elnes'
half 'elne' white 'taffities' of Genoa.

I've left out details of the dates and price and people concerned and turned
the old Scots into modern English where I am certain of the meaning. I
presume 'elnis/elnes' are measures and that 'taffities' is a type of fabric.
Red and yellow were the Stuart livery colours and were sometimes used as the
field of the white cross. There is no indication of how the two colours were
arranged.
David Prothero, 24 November 1998

July 1st 1999 was a very special day for Scotland and her people:
after nearly three hundred years Scots regained the right to govern
themselves, with the opening of the Scottish parliament in Edinburgh.
It was a day full of flags, mainly the Saltire of Scotland, but with
lots of others. The palace of Holyrood House was flying the new
Scottish royal standard (at least "new"
in terms of being used) while the queen was in residence. Edinburgh
Castle was flying the Union Flag as a royal fortress and the General
Assembly building, the temporary home of the new parliament, was
flying the Union Flag on its left tower and the Saltire on its right
tower (it has a twin-towered gateway).
Graham Bartram, 4 July 1999

The "Scottish Clan & Family Encyclopedia" notes that the Saltire: blue with a
white diagonal cross, is the flag of St. Andrew, patron of Scotland. It is the
correct flag for Scots or Scottish corporate bodies to demonstrate their loyalty
and nationality.Randy Young, 19 March 2004

Of the flags of England, Scotland and Wales only the Scottish Saltire is,
established by (Scottish) Constitutional Law, the Cross of St George is (as
David states) established by custom and practice and the Welsh Dragon by Order
in Council? In this instance I am taking the phrase "Constitutional Law" to mean
'Parliamentary Law', and not for a moment forgetting both the importance of
"custom and practice" in English common law, and the legal status of a Royal
Order in Council issued under the Royal Prerogative.Christopher Southworth, 15 April 2004

The Sunday Times reported:
"Last year the First Minister (Jack McConnell) introduced a policy (23 November
2004) of flying the Saltire above all public buildings to instill national pride
and to promote the country to foreigners. The flag is displayed at the
Parliament, at Bute House, the First Minister's official residence and at
Scottish Executive offices."

Some other examples of how the saltire is used include:

flag poles outside Perth's library and on a flag pole high up on the main
Perth & Kinross Council building, at least three hotels and on Perth's museum.

Perth's football (soccer) stadium when it hosts a international football
(soccer) match, involving Scotland.

Balhousie Castle in which the region's British Army infantry Regiment
(Black Watch), has its museum has on its highest point, only a large Saltire
flying from a flag pole. Five weeks ago, the Black Watch recruited in Perth's
High Street. The exhibition trailer they used had two short flag poles, with
two large Saltires and a billboard with poster depicting a large Saltire.
Underneath the poster's Saltire were photos of infantry soldiers, armoured
vehicles and the large words "SCOTTISH INFANTRY". There seemed to be no sign
of a Union flag.

The Black Watch, which has only one battalion, the 1st, while in Iraq
occupied a base named Camp Dogwood where the base's flag flying from a tall
flagpole was a Saltire and not a Union flag.

It is common for a Scottish Regiment's armoured vehicles to have a small
painted Saltire, on their turrets and trucks often have a painted Saltire on a
bumper.

Five of the Black Watch were killed during this operation, four Scots and
one Fijian. Television and newspaper reports of the two funerals, I saw showed
each coffin, having a Saltire draped over it.

In July 2005, a Norwegian three masted tall ship visited Montrose and in
June 2002, a Danish three masted tall ship visited Dundee. Both, flew a Saltire
as the courtesy flag.

The Scot 100 South Pole Expedition, a dedicated Scottish expedition ended
successfully in December 2004. Craig Mathieson who skied most of the way
across Antarctica solo, flew a Saltire on reaching the South Pole.

The Magazine "Scotland on Sunday" reported discussion on the
introduction of a flag for the Scottish Parliament. It was reported that
Members of Scottsih Parliament (MSPs) want to create a distinctive emblem to fly
over Holyrood in a bid to promote its identity and restore pride. Among the new
designs expected to be considered by the parliamentís cross-party housekeeping
group is a version of the parliamentís existing logo, which features a Saltire
against a purple backdrop with a crown above and cords to each side. Some
Scottish Nationalist MSPs, however, are opposed to the idea, believing that as
Scotlandís national flag, only the Saltire should
fly above Holyrood.

Extracted from Scotland on Sunday, (click
here for full article) located by Phil Nelson, 3 January 2003

In response to this article, and a query directed to the
Scottish Parliament, the following reply was received:

"The article that appeared in Scotland on Sunday in December
2002 refers to 'new designs expected to be considered by the parliament's
cross-party housekeeping group'. I can confirm that the Scottish Parliamentary
Corporate Body (SPCB - the 'cross-party housekeeping group') did consider the
issue of having a parliamentary flag, but the matter is not currently a priority
and I believe that it has not been taken any further. Should it wish to do so,
the new SPCB elected by the new Parliament in May could consider the issue again
in the future.
I hope that this will be of assistance.Elizabeth Cantlie
Public Information Service, The Scottish Parliament