Thanks for your reply.
I've tried the iMac in two separate rooms in my house. All directly into the main plug socket.
It does seem like some heat related issue, as the iMac just switches off. Like a killswitch. From my limited knowledge I think there is some form of fail safe in computer to turn it off if it gets too hot.
I'm just quite shocked that if it is again a hardware issue, I've had two iMacs with this problem! I'm racking my brains to see if it is something else, but logically it does seem hardware related.
In answer to the above, the longer the computer is off, the longer it will stay on when I next try it. If it goes off and I try it again straight away it lasts only a few seconds...
I've reset the pram and gone through the smc process. As the is doesn't even load the os, it can't be corruption that is causing it.
I think I may have been unlucky... Again...
Seen quite a few power related issues in this forum. A few with the new iMacs like I have too.
Wonder if this is a bigger problem with this model?
I also purchased new 27" IMAC on 25/01/2013, after having former model for 3 years with no problems. The new one is also shutting down randomly.
I have spoken to apple who say that they are not aware of any problems, have clicked report to all the on screen notices but as yet have not received a response. Called the John Lewis the company who supplied it and they have offered collection for tomorrow with full refund. They dont have a replacement in stock for 3 weeks.
Apple shop have one in but looking at reports online, I am reluctant to jump straight in for another one just yet.